Commit 6ab04a64 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix for "-" in references

parent aa2066fb
Loading
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -773,6 +773,7 @@ def update_heading_styles(docx_input, docx_output):
            pStyle_elems = para.xpath('./w:pPr/w:pStyle[@w:val="Heading1"]', namespaces=ns)
            if pStyle_elems:
                pStyle_elems[0].set(f"{{{ns['w']}}}val", "Heading8")  
            insert_page_break_before_heading(para, full_text)  
            counter_annex += 1
        # Annex subheading Heading 2: "A.1 Title", not matching "A.1.1 Title"
        elif (match := re.match(r'^\s*([A-Z]\.\d+)\s+(.+)$', full_text)) is not None:
@@ -1971,7 +1972,7 @@ def update_body_text_style(docx_input, docx_output):
            print(f'Changed style to "H6" for: "{full_text_stripped}"')
        elif re.match(r'^Editor[\'’]s\s+Note:', full_text_stripped, re.IGNORECASE):
            elem.set(f"{{{ns['w']}}}val", new_style)
            print(f'Changed style to "NO" for "Editor\'s Note:" "{full_text_stripped}"')
            print(f'Changed style to "{new_style}" for "Editor\'s Note:" "{full_text_stripped}"')
            
            # Add yellow highlighting to all runs in this paragraph (including runs inside hyperlinks)
            all_runs = para.xpath('.//w:r', namespaces=ns)
@@ -2469,12 +2470,12 @@ def update_format_styles_cli():
    update_figure_captions(args.docx_input, args.docx_output)
    update_heading_styles(args.docx_input, args.docx_output)
    update_figure_style(args.docx_input, args.docx_output)
    update_unnumbered_lists(args.docx_input, args.docx_output)
    update_table_captions(args.docx_input, args.docx_output)
    update_abbreviations(args.docx_input, args.docx_output)
    update_table_rows(args.docx_input, args.docx_output)
    update_notes(args.docx_input, args.docx_output)
    update_references(args.docx_input, args.docx_output)
    update_unnumbered_lists(args.docx_input, args.docx_output)
    update_body_text_style(args.docx_input, args.docx_output)
    add_no_break_hyphens(args.docx_input, args.docx_output)
    update_references_style(args.docx_input, args.docx_output)