Skip to content

Commit ecdcf12

Browse files
Merge pull request #3805 from raspberrypi/develop
Roll out latest changes to production
2 parents fb5710b + f4b5a54 commit ecdcf12

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/create_nav.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def heading_to_anchor(filepath, heading, anchor):
1717
if anchor is None:
1818
# The replace(' -- ', '') is needed because AsciiDoc transforms ' -- ' to ' — ' (narrow-space, em-dash, narrow-space) which then collapses down to '' when calculating the anchor
1919
anchor = re.sub(r'\-+', '-', re.sub(r'[^-\w]', '', heading.lower().replace(' -- ', '').replace(' ', '-').replace('.', '-')))
20+
# remove any context tags that slipped into the anchor
21+
anchor = re.sub(r'(strong-classcontexttag-)(rp\d+)(rp\d+strong)', '\\2', anchor)
2022
if filepath not in file_headings:
2123
file_headings[filepath] = set()
2224
proposed_anchor = anchor

0 commit comments

Comments
 (0)