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

Add some more symbols to be removed from the bookmark id

parent 81a7c589
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for generateBaseline/postprocessing.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1117,7 +1117,7 @@ def update_heading_styles(docx_input, docx_output):
        # "10.1" + "Imports other md files" becomes "101-imports-other-md-files". Any other symbols ".", ",", ":", ";", "!", "[", "]" are removed.
        # 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)
        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)