Skip to content

Commit

Permalink
Merge pull request #1058 from sphinx-contrib/replace-v2-anchor-check-…
Browse files Browse the repository at this point in the history
…for-named-entries

translator: replace spaces with dashes when resolving title anchors
  • Loading branch information
jdknight authored Nov 6, 2024
2 parents 6c2d102 + f903ecf commit f6dcc89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sphinxcontrib/confluencebuilder/storage/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ def visit_title(self, node):
# repsective document name) which helps allow `ac:link` macros
# properly link when coming from v1 or v2 editor pages.
if self.v2 and 'names' in node.parent:
for anchor in node.parent['names']:
for name in node.parent['names']:
anchor = name.replace(' ', '-')
target_name = f'{docname}/#{anchor}'
target = self.state.target(target_name)
if target and target not in new_targets:
Expand Down

0 comments on commit f6dcc89

Please sign in to comment.