From 595f3be9880e63b0af479ffd88a31ef87c3ae8f5 Mon Sep 17 00:00:00 2001 From: Ravin Kumar Date: Thu, 28 Apr 2022 19:31:21 -0700 Subject: [PATCH 1/2] Add content expansion --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 1740df88..73579807 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 From 392bf981184ff1503f4a895b34d281d9f26dbbe0 Mon Sep 17 00:00:00 2001 From: Ravin Kumar Date: Thu, 28 Apr 2022 19:53:03 -0700 Subject: [PATCH 2/2] Add content tag static expansion --- pelican/tests/test_contents.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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'})