Commit 782190fa authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix ref name

parent 6b3f2802
Loading
Loading
Loading
Loading
Loading
+2
Changes for generateBaseline/postprocessing.py: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2462,6 +2462,8 @@ def update_references(docx_input, docx_output):
    def _unique_ref_bookmark_name(para_text):
        # REF_ plus letters and digits from the reference title. Word names are at most 40 characters.
        body = re.sub(r'^\[(?:i\.)?(?:\d+|n)\]\s*', '', para_text, count=1, flags=re.IGNORECASE)
        if ':' in body:
            body = body.split(':', 1)[0]
        slug = re.sub(r'[^A-Za-z0-9]', '', body).upper() or "REF"
        base = f"REF_{slug}"
        name = base[:40]