From 7caf3528c5dc5e641e89fc996b086592c6561ef2 Mon Sep 17 00:00:00 2001 From: "(GalaxyMaster)" Date: Tue, 11 Jul 2023 10:54:38 +1000 Subject: [PATCH] Reverted the Jinja2 related changes as per the discussion. --- pelican/tests/test_utils.py | 6 ------ pelican/utils.py | 3 --- 2 files changed, 9 deletions(-) diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index a189fbab..f1933f50 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -255,12 +255,6 @@ class TestUtils(LoggedTestCase): 'marker'), '' + 'word ' * 20 + 'marker') - # Words with HTML tags and a Jinja2 generated end marker (Markup) - self.assertEqual( - utils.truncate_html_words('

' + 'word ' * 100 + '

', 20, - Markup('marker')), - '

' + 'word ' * 20 + 'marker

') - # Words with hypens and apostrophes. self.assertEqual( utils.truncate_html_words("a-b " * 100, 20), diff --git a/pelican/utils.py b/pelican/utils.py index a3f9a9e1..b69cbf95 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -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: