forked from github/pelican
Merge pull request #2115 from jvoisin/_update_content_regexp_simplification
Improve the regexp used in _update_content
This commit is contained in:
commit
c2b2def1c8
2 changed files with 23 additions and 2 deletions
|
|
@ -771,3 +771,24 @@ class TestStatic(LoggedTestCase):
|
|||
count=1,
|
||||
msg="Unable to find 'foo', skipping url replacement.",
|
||||
level=logging.WARNING)
|
||||
|
||||
def test_index_link_syntax_with_spaces(self):
|
||||
"""{index} link syntax triggers url replacement
|
||||
with spaces around the equal sign."""
|
||||
|
||||
html = '<a href = "{index}">link</a>'
|
||||
page = Page(
|
||||
content=html,
|
||||
metadata={'title': 'fakepage'},
|
||||
settings=self.settings,
|
||||
source_path=os.path.join('dir', 'otherdir', 'fakepage.md'),
|
||||
context=self.context)
|
||||
content = page.get_content('')
|
||||
|
||||
self.assertNotEqual(content, html)
|
||||
|
||||
expected_html = ('<a href = "' +
|
||||
'/'.join((self.settings['SITEURL'],
|
||||
self.settings['INDEX_SAVE_AS'])) +
|
||||
'">link</a>')
|
||||
self.assertEqual(content, expected_html)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue