diff --git a/scripts/create_nav.py b/scripts/create_nav.py index 16b1120a6..df0d9a580 100755 --- a/scripts/create_nav.py +++ b/scripts/create_nav.py @@ -17,6 +17,8 @@ def heading_to_anchor(filepath, heading, anchor): if anchor is None: # The replace(' -- ', '') is needed because AsciiDoc transforms ' -- ' to ' — ' (narrow-space, em-dash, narrow-space) which then collapses down to '' when calculating the anchor anchor = re.sub(r'\-+', '-', re.sub(r'[^-\w]', '', heading.lower().replace(' -- ', '').replace(' ', '-').replace('.', '-'))) + # remove any context tags that slipped into the anchor + anchor = re.sub(r'(strong-classcontexttag-)(rp\d+)(rp\d+strong)', '\\2', anchor) if filepath not in file_headings: file_headings[filepath] = set() proposed_anchor = anchor