mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix #1342 replace intrasite links also in summary metadata
Thanks to @Chimrod for pointing this out.
This commit is contained in:
parent
9a753f4fa9
commit
9e39033212
2 changed files with 15 additions and 1 deletions
|
|
@ -278,7 +278,8 @@ class Content(object):
|
|||
content.
|
||||
"""
|
||||
if hasattr(self, '_summary'):
|
||||
return self._summary
|
||||
return self._update_content(self._summary,
|
||||
self._context.get('localsiteurl', ''))
|
||||
|
||||
if self.settings['SUMMARY_MAX_LENGTH'] is None:
|
||||
return self.content
|
||||
|
|
|
|||
|
|
@ -287,6 +287,19 @@ class TestPage(unittest.TestCase):
|
|||
'?utm_whatever=234&highlight=word#section-2">link</a>'
|
||||
)
|
||||
|
||||
# also test for summary in metadata
|
||||
args['metadata']['summary'] = (
|
||||
'A simple summary test, with a '
|
||||
'<a href="|filename|article.rst">link</a>'
|
||||
)
|
||||
args['context']['localsiteurl'] = 'http://notmyidea.org'
|
||||
p = Page(**args)
|
||||
self.assertEqual(
|
||||
p.summary,
|
||||
'A simple summary test, with a '
|
||||
'<a href="http://notmyidea.org/article.html">link</a>'
|
||||
)
|
||||
|
||||
def test_intrasite_link_more(self):
|
||||
# type does not take unicode in PY2 and bytes in PY3, which in
|
||||
# combination with unicode literals leads to following insane line:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue