Skip to content

Commit

Permalink
Merge pull request #3001 from canyon289/content_expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Jul 11, 2022
2 parents c46554a + 392bf98 commit 5c222ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pelican/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def _get_intrasite_link_regex(self):
intrasite_link_regex = self.settings['INTRASITE_LINK_REGEX']
regex = r"""
(?P<markup><[^\>]+ # 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<quote>["\']) # require value to be quoted
(?P<path>{}(?P<value>.*?)) # the url value
Expand Down
10 changes: 10 additions & 0 deletions pelican/tests/test_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,16 @@ def test_intrasite_link_absolute(self):
'<img src="http://static.cool.site/images/poster.jpg"/>'
)

# Image link will go to static
args['content'] = (
'<meta content="{static}/images/poster.jpg"/>'
)
content = Page(**args).get_content('http://cool.site')
self.assertEqual(
content,
'<meta content="http://static.cool.site/images/poster.jpg"/>'
)

def test_intrasite_link_escape(self):
article = type(
'_DummyArticle', (object,), {'url': 'article-spaces.html'})
Expand Down

0 comments on commit 5c222ef

Please sign in to comment.