diff --git a/src/book.py b/src/book.py index 78aecbb..87f0802 100644 --- a/src/book.py +++ b/src/book.py @@ -399,6 +399,13 @@ class Book: paragraphs = self.body_tag.find_all('p') for p in paragraphs: + # libra converts some \n into
with 2
+ # there we remove 1 unnecessary
+ brs = p.find_all('br')
+ text = p.text
+ if brs and text == '\n\n' and len(brs) == 2:
+ brs[0].decompose()
+
align = p.get('align')
style = p.get('style')
@@ -772,7 +779,7 @@ class Book:
il_tag.attrs.update(il_tag.p.attrs)
il_tag.p.unwrap()
- def write_html_from_list(self, file_name='url_test.html'):
+ def write_html_from_list(self, file_name='json/url_test.html'):
folder_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
file_path = pathlib.Path(os.path.join(folder_path, file_name))