documentation_crawler: Stop treating all portico URLs as external.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2019-07-17 23:16:30 -07:00 committed by Tim Abbott
parent 51edc4bf4c
commit 586aaddcc0
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,14 @@ class APIDocumentationSpider(UnusedImagesLinterSpider):
images_path = "static/images/api"
class PorticoDocumentationSpider(BaseDocumentationSpider):
def _is_external_url(self, url: str) -> bool:
return (
not url.startswith('http://localhost:9981')
or url.startswith('http://localhost:9981/help')
or url.startswith('http://localhost:9981/api')
or self._has_extension(url)
)
name = 'portico_documentation_crawler'
start_urls = ['http://localhost:9981/hello',
'http://localhost:9981/history',

View File

@ -31,6 +31,10 @@ VNU_IGNORE = re.compile(r'|'.join([
r'The first occurrence of ID “[^”]*” was here\.',
r'Attribute “markdown” not allowed on element “div” at this point\.',
r'No “p” element in scope but a “p” end tag seen\.',
r'Element “div” not allowed as child of element “ul” in this context\. '
+ r'\(Suppressing further errors from this subtree\.\)',
r'The element “button” must not appear as a descendant of the “a” element\.',
r'Attribute “href” not allowed on element “button” at this point\.',
# Warnings that are probably less important.
r'The “type” attribute is unnecessary for JavaScript resources\.',