mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-05 08:40:13 -04:00
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:
parent
c329776346
commit
7658dc65d9
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user