Skip to content

Commit

Permalink
Allow dashes in manual page URL fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
jtackaberry committed Mar 1, 2022
1 parent 2c4d046 commit 7300b16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ def parse_manual(self, scope, f):
if ref == topref:
ref.flags['display'] = heading
ref.update()
symbol = re.sub(r'[^a-zA-Z0-9 ]', '', heading.lower()).replace(' ', '_')
# Symbol is used for URL fragment
symbol = re.sub(r'[^a-zA-Z0-9- ]', '', heading.lower())
symbol = re.sub(r' +', '_', symbol).replace('_-_', '-')
ref = Reference(self, file=path, line=n, type='section', scopes=[topref], symbol=symbol)
ref.flags['display'] = heading
ref.flags['level'] = level
Expand Down

0 comments on commit 7300b16

Please sign in to comment.