Commit 7e08c6c2 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix for Examples regex

parent 905e98a9
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1936,7 +1936,7 @@ def update_notes(docx_input, docx_output):
        note_pattern = re.compile(r'NOTES?\s*\d*:?\s+')
        note_match = note_pattern.search(full_text)
        # Check if text matches EXAMPLE pattern: EXAMPLE\s*\d*:
        example_pattern = re.compile(r'EXAMPLES?\s*\d*:?\s+')
        example_pattern = re.compile(r'EXAMPLES?\s*\d*:?\s*')
        example_match = example_pattern.search(full_text)
        if note_match:
            # Change style to NO
@@ -1990,7 +1990,7 @@ def update_notes(docx_input, docx_output):
            pStyle_elem.set(f"{{{ns['w']}}}val", example_style)
            counter_ew += 1
            
            # Get the matched text (e.g., "EXAMPLE:", "EXAMPLE 1:", "EXAMPLE :")
            # Get the matched text (e.g., "EXAMPLE:", "EXAMPLE 1:", "EXAMPLE :", "EXAMPLES:")
            matched_example = example_match.group(0)
            
             # Find and remove the matched EXAMPLE pattern from the first run that contains it (EXAMPLE won't be in hyperlinks)