- if link.startswith('#'):
- _pwarn(path, 'External link starts with #: "{}"'.format(link))
+ href = hrefp.search(link)
+ classes = classesp.search(link)
+
+ if classes is None:
+ _pwarn(path, 'External link has no "ext" class: "{}"'.format(link))
+ else:
+ classes = classes.group(1).split(' ')
+
+ if 'int' not in classes and 'ext' not in classes:
+ _pwarn(path, 'External link has no "ext" class: "{}"'.format(link))
+
+ if href is not None:
+ if href.group(1).startswith('#'):
+ _pwarn(path, 'External link starts with #: "{}"'.format(href))
+ else:
+ _perror(path, 'External link with no "href": "{}"'.format(link))