Loading md_to_docx_converter/src/to_docx/preprocessing.py +11 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,16 @@ def remove_badges(soup: BeautifulSoup): return soup def remove_citations(soup: BeautifulSoup): """ Adjust citation elements to ensure they are properly formatted for Docx conversion. """ citations = soup.find_all("span", class_="citation") for citation in citations: citation.unwrap() return soup def compute_height_and_width_from_file(file_path: str): """ Loading Loading @@ -709,6 +719,7 @@ def preprocess( soup = remove_pandoc_toc(soup) soup = remove_badges(soup) soup = remove_citations(soup) soup = change_images_to_use_high_quality(soup, src) soup = modify_links(soup) soup = handle_italic_monospace(soup) Loading Loading
md_to_docx_converter/src/to_docx/preprocessing.py +11 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,16 @@ def remove_badges(soup: BeautifulSoup): return soup def remove_citations(soup: BeautifulSoup): """ Adjust citation elements to ensure they are properly formatted for Docx conversion. """ citations = soup.find_all("span", class_="citation") for citation in citations: citation.unwrap() return soup def compute_height_and_width_from_file(file_path: str): """ Loading Loading @@ -709,6 +719,7 @@ def preprocess( soup = remove_pandoc_toc(soup) soup = remove_badges(soup) soup = remove_citations(soup) soup = change_images_to_use_high_quality(soup, src) soup = modify_links(soup) soup = handle_italic_monospace(soup) Loading