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: