Set up local docx_converter

This commit is contained in:
Kiryl
2022-07-14 19:13:34 +03:00
parent 7b35d8a7c2
commit b1ccd796c9
2 changed files with 8 additions and 7 deletions

View File

@@ -26,15 +26,13 @@ def preprocess_footnotes(source_html_tag: Tag, href2soup_html: dict = None, note
<aside epub:type="footnote" id="n1"><p>With a footnote here.</p></aside>
"""
footnotes = []
footnotes, new_noterefs_tags, new_footnotes_tags = [], [], []
noterefs_tags = source_html_tag.find_all(
attrs={noteref_attr_name: "noteref"})
bad_noterefs_tags = set(
[tag for tag in noterefs_tags if not tag.attrs.get("href")])
noterefs_tags = [
tag for tag in noterefs_tags if tag not in bad_noterefs_tags]
new_noterefs_tags = []
new_footnotes_tags = []
[tag.decompose() for tag in bad_noterefs_tags]
def parse_a_tag_href(s: str) -> Tuple[str, str]: