Skip to content

fix(anchors): pass title prefix through rendering pipeline#66

Merged
geopanther merged 3 commits into
mainfrom
fix/anchor-prefix-title
May 19, 2026
Merged

fix(anchors): pass title prefix through rendering pipeline#66
geopanther merged 3 commits into
mainfrom
fix/anchor-prefix-title

Conversation

@geopanther
Copy link
Copy Markdown
Owner

Summary

Fix broken anchor links when using --prefix flag. Anchors were built with the original page title, but the prefix was applied later, causing TOC links to point to non-existent anchors.

Changes

  • Thread title_prefix parameter through get_page_data_from_file_path, get_page_data_from_lines, get_pages_from_directory, and parse_page so build_anchor_map_from_markdown receives the correct prefixed title
  • Remove post-hoc anchor rewriting in __main__.py in favor of correct upfront title
  • Upgrade idna 3.13 → 3.15 (fixes GHSA-65pc-fj4g-8rjx)

Tests

  • Added TestAnchorWithTitlePrefix covering: prefix anchor generation, no-prefix unchanged behavior, multiple headings
  • All 167 existing tests pass (tox)

When --prefix is used, Confluence anchors must include the prefixed
page title. Previously, anchors were built with the original title
from markdown, then the prefix was applied to the page title later,
causing broken TOC links.

Thread title_prefix parameter through get_page_data_from_file_path,
get_page_data_from_lines, get_pages_from_directory, and parse_page
so build_anchor_map_from_markdown receives the correct prefixed title.
Cover anchor generation with and without --prefix flag,
including multiple headings scenario.
@geopanther geopanther merged commit ccdc572 into main May 19, 2026
5 checks passed
@geopanther geopanther deleted the fix/anchor-prefix-title branch May 19, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant