Commit 1504ecef authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix when removing leading spaces in references text

parent ddb7613e
Loading
Loading
Loading
Loading
Loading
+3 −1
Changes for generateBaseline/postprocessing.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2510,7 +2510,9 @@ def update_references(docx_input, docx_output):
            ref_index = list(parent).index(reference_run)
            parent.insert(ref_index + 1, tab_run)
            # Trim any space in the next w:r/w:t element after the tab run
            next_elem = parent[ref_index + 2]
            next_index = ref_index + 2
            if next_index < len(parent):
                next_elem = parent[next_index]
                if next_elem.tag.endswith('}r') and next_elem.xpath('.//w:t', namespaces=ns):
                    next_text = next_elem.xpath('.//w:t', namespaces=ns)[0].text
                    if next_text: