mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
flake8 fixes
This commit is contained in:
parent
b573576b00
commit
fc7af9e1c3
2 changed files with 16 additions and 10 deletions
|
|
@ -218,12 +218,18 @@ class TestUtils(LoggedTestCase):
|
|||
"∫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', 20), '&mdash')
|
||||
self.assertEqual(utils.truncate_html_words('Ӓ', 20), 'Ӓ')
|
||||
self.assertEqual(utils.truncate_html_words('઼', 20), '઼')
|
||||
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', 20), '&mdash')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('Ӓ', 20), 'Ӓ')
|
||||
self.assertEqual(
|
||||
utils.truncate_html_words('઼', 20), '઼')
|
||||
|
||||
def test_process_translations(self):
|
||||
fr_articles = []
|
||||
|
|
|
|||
|
|
@ -552,15 +552,15 @@ class _HTMLWordTruncator(HTMLParser):
|
|||
|
||||
def _handle_ref(self, name, char):
|
||||
"""
|
||||
Called by handle_entityref() or handle_charref() when a ref like
|
||||
Called by handle_entityref() or handle_charref() when a ref like
|
||||
`—`, `—`, or `—` is found.
|
||||
|
||||
|
||||
The arguments for this method are:
|
||||
|
||||
|
||||
- `name`: the HTML entity name (such as `mdash` or `#8212` or `#x2014`)
|
||||
- `char`: the Unicode representation of the ref (such as `—`)
|
||||
|
||||
This method checks whether the entity is considered to be part of a
|
||||
This method checks whether the entity is considered to be part of a
|
||||
word or not and, if not, signals the end of a word.
|
||||
"""
|
||||
# Compute the index of the character right after the ref.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue