Putting back the paragraph deduplication.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
3d2bb6f5be
commit
7a522f33ef
|
@ -68,8 +68,9 @@ def right_align_header(document):
|
|||
|
||||
|
||||
def double_space_and_indent(paragraphs):
|
||||
previous_paragraph = None
|
||||
this_paragraph_plaintext = False
|
||||
previous_paragraph_plaintext = False
|
||||
previous_paragraph_plaintext = None
|
||||
|
||||
for paragraph in paragraphs:
|
||||
paragraph.paragraph_format.line_spacing = 2
|
||||
|
@ -88,6 +89,10 @@ def double_space_and_indent(paragraphs):
|
|||
if this_paragraph_plaintext and previous_paragraph_plaintext:
|
||||
paragraph.paragraph_format.first_line_indent = docx.shared.Inches(0.5)
|
||||
|
||||
if previous_paragraph and paragraph.style == previous_paragraph.style and not paragraph.text and not previous_paragraph.text:
|
||||
previous_paragraph._element.getparent().remove(previous_paragraph._element)
|
||||
|
||||
previous_paragraph = paragraph
|
||||
previous_paragraph_plaintext = this_paragraph_plaintext
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue