From 7658dc65d94792033b7019935e46fb1edf694c92 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 May 2019 11:40:18 +0530 Subject: [PATCH] Remove manual fixup of
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) --- src/calibre/library/comments.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/comments.py b/src/calibre/library/comments.py index ed0e34233f..ffb6282d9b 100644 --- a/src/calibre/library/comments.py +++ b/src/calibre/library/comments.py @@ -128,7 +128,7 @@ def comments_to_html(comments): for p in container.findAll('p'): p['class'] = 'description' - return container.decode_contents().replace('

', '
') + return container.decode_contents() def markdown(val): @@ -169,6 +169,9 @@ def find_tests(): '

a b

cd

'), ]: cval = comments_to_html(pat) + # normalize
representations produced by different + # versions of html5-parser + cval = cval.replace('

', '
').replace('
', '
') self.assertEqual(cval, val) return unittest.defaultTestLoader.loadTestsFromTestCase(Test)