diff --git a/pelican/contents.py b/pelican/contents.py index a06a1a6a..83394b9c 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -371,9 +371,7 @@ class Content: def _get_intrasite_link_regex(self) -> re.Pattern: intrasite_link_regex = self.settings["INTRASITE_LINK_REGEX"] regex = rf""" - (?P<[^\>]+ # match tag with all url-value attributes - (?:href|src|poster|data|cite|formaction|action|content)\s*=\s*) - + (?P(?:href|src|poster|data|cite|formaction|action|content)\s*=\s*) (?P["\']) # require value to be quoted (?P{intrasite_link_regex}(?P.*?)) # the url value (?P=quote)""" diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 4b1effa2..0975a3ad 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -532,6 +532,9 @@ class TestPage(TestBase): "images/poster.jpg": Static( "", settings=args["settings"], source_path="images/poster.jpg" ), + "images/placeholder.jpg": Static( + "", settings=args["settings"], source_path="images/placeholder.jpg" + ), } args["context"]["generated_content"] = { "article.rst": Article( @@ -560,6 +563,16 @@ class TestPage(TestBase): content, '' ) + # Image with two links + args["content"] = ( + '' + ) + content = Page(**args).get_content("http://cool.site") + self.assertEqual( + content, + '', + ) + # Image link will go to static args["content"] = '' content = Page(**args).get_content("http://cool.site")