Commit 98953a52 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Remove any leading space in references text

parent d4840856
Loading
Loading
Loading
Loading
Loading
+6
Changes for generateBaseline/postprocessing.py: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2509,6 +2509,12 @@ def update_references(docx_input, docx_output):
        if parent is not None:
            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]
            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:
                    next_elem.xpath('.//w:t', namespaces=ns)[0].text = next_text.lstrip()
        
        counter += 1