mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Reverted the Jinja2 related changes as per the discussion.
This commit is contained in:
parent
fbe4a587c5
commit
7caf3528c5
2 changed files with 0 additions and 9 deletions
|
|
@ -255,12 +255,6 @@ class TestUtils(LoggedTestCase):
|
|||
'<span>marker</span>'),
|
||||
'<!-- comment -->' + 'word ' * 20 + '<span>marker</span>')
|
||||
|
||||
# Words with HTML tags and a Jinja2 generated end marker (Markup)
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('<p>' + 'word ' * 100 + '</p>', 20,
|
||||
Markup('<span>marker</span>')),
|
||||
'<p>' + 'word ' * 20 + '<span>marker</span></p>')
|
||||
|
||||
# Words with hypens and apostrophes.
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words("a-b " * 100, 20),
|
||||
|
|
|
|||
|
|
@ -580,9 +580,6 @@ def truncate_html_words(s, num, end_text='…'):
|
|||
return s
|
||||
out = s[:truncator.truncate_at]
|
||||
if end_text:
|
||||
# check if the passed terminator was Jinja2 generated (i.e. Markup)
|
||||
if isinstance(end_text, Markup):
|
||||
end_text = end_text.unescape()
|
||||
out += ' ' + end_text
|
||||
# Close any tags still open
|
||||
for tag in truncator.open_tags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue