Loading md_to_docx_converter/src/to_docx/postprocessing.py +4 −2 Original line number Diff line number Diff line Loading @@ -551,10 +551,12 @@ def add_tagged_styles_and_formatting(doc: Doc): def set_keep_with_next_false(doc: Doc): """By default, `keep with next` is set to `True`. This has the effect of adding blocks of whitespace throughout the document. For all paragraphs, ensure `keep with next` is set to `False` to maintain visual continuity within the document.""" previous_paragraph = None for paragraph in iter_paragraphs(doc): paragraph.paragraph_format.keep_with_next = False paragraph.paragraph_format.space_after = Pt(12) if previous_paragraph and previous_paragraph.style.name in "Compact" and paragraph.style.name not in "Compact": previous_paragraph.paragraph_format.space_after = Pt(12) previous_paragraph = paragraph return doc Loading Loading
md_to_docx_converter/src/to_docx/postprocessing.py +4 −2 Original line number Diff line number Diff line Loading @@ -551,10 +551,12 @@ def add_tagged_styles_and_formatting(doc: Doc): def set_keep_with_next_false(doc: Doc): """By default, `keep with next` is set to `True`. This has the effect of adding blocks of whitespace throughout the document. For all paragraphs, ensure `keep with next` is set to `False` to maintain visual continuity within the document.""" previous_paragraph = None for paragraph in iter_paragraphs(doc): paragraph.paragraph_format.keep_with_next = False paragraph.paragraph_format.space_after = Pt(12) if previous_paragraph and previous_paragraph.style.name in "Compact" and paragraph.style.name not in "Compact": previous_paragraph.paragraph_format.space_after = Pt(12) previous_paragraph = paragraph return doc Loading