Remove manual fixup of <br> in comments_to_html

Not needed with html5-parser 0.4.6
Modify the test to work with all versions of html5-parser
Fixes #990 (Update testsuite for html5-parser 0.4.6 changes)
This commit is contained in:
Kovid Goyal 2019-05-14 11:40:18 +05:30
parent c329776346
commit 7658dc65d9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -128,7 +128,7 @@ def comments_to_html(comments):
for p in container.findAll('p'):
p['class'] = 'description'
return container.decode_contents().replace('<br></br>', '<br>')
return container.decode_contents()
def markdown(val):
@ -169,6 +169,9 @@ def find_tests():
'<p class="description">a b</p><p class="description">cd</p>'),
]:
cval = comments_to_html(pat)
# normalize <br> representations produced by different
# versions of html5-parser
cval = cval.replace('<br></br>', '<br>').replace('<br/>', '<br>')
self.assertEqual(cval, val)
return unittest.defaultTestLoader.loadTestsFromTestCase(Test)