mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #2285 from andreacorbellini/2263-handle-invalid-refs
Fix utils.truncate_html_words() to work with invalid HTML references
This commit is contained in:
commit
b4d5e4285e
2 changed files with 70 additions and 10 deletions
|
|
@ -217,6 +217,20 @@ class TestUtils(LoggedTestCase):
|
|||
utils.truncate_html_words("∫dx " * 100, 20),
|
||||
"∫dx " * 20 + '…')
|
||||
|
||||
# Words with invalid or broken HTML references.
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('&invalid;', 20), '&invalid;')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('�', 20), '�')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('�', 20), '�')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('&mdash text', 20), '&mdash text')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('Ӓ text', 20), 'Ӓ text')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('઼ text', 20), '઼ text')
|
||||
|
||||
def test_process_translations(self):
|
||||
fr_articles = []
|
||||
en_articles = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue