diff --git a/pelican/contents.py b/pelican/contents.py index 6ffffdc3..e59fa9ae 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -337,7 +337,7 @@ class Content: intrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] regex = r""" (?P<[^\>]+ # match tag with all url-value attributes - (?:href|src|poster|data|cite|formaction|action)\s*=\s*) + (?:href|src|poster|data|cite|formaction|action|content)\s*=\s*) (?P["\']) # require value to be quoted (?P{}(?P.*?)) # the url value diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 32012d4f..3a223b5a 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -522,6 +522,16 @@ class TestPage(TestBase): '' ) + # Image link will go to static + args['content'] = ( + '' + ) + content = Page(**args).get_content('http://cool.site') + self.assertEqual( + content, + '' + ) + def test_intrasite_link_escape(self): article = type( '_DummyArticle', (object,), {'url': 'article-spaces.html'})