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

Fix for creating bookmarks to remove punctuation marks

parent 554c71d8
Loading
Loading
Loading
Loading
Loading
+1
Changes for generateBaseline/postprocessing.py: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -1117,6 +1117,7 @@ def update_heading_styles(docx_input, docx_output):
        # "10.1" + "Imports other md files" becomes "101-imports-other-md-files".
        # The bookmark covers the number run only. Pandoc's heading bookmark is left unchanged.
        title_slug = re.sub(r'\s+', '-', title.strip()).lower()
        title_slug = re.sub(r'[.,:;!]', '', title_slug)
        bookmark_name = f"{number.replace('.', '')}-{title_slug}"
        _remove_bookmarks(root, ns, {bookmark_name}, paragraph=para, hashed=True)
        _insert_bookmark_around(label_run, bookmark_name, next_bookmark_id, ns)