fix(anchors): pass title prefix through rendering pipeline#66
Merged
Conversation
Fixes GHSA-65pc-fj4g-8rjx (medium severity).
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix broken anchor links when using
--prefixflag. Anchors were built with the original page title, but the prefix was applied later, causing TOC links to point to non-existent anchors.Changes
title_prefixparameter throughget_page_data_from_file_path,get_page_data_from_lines,get_pages_from_directory, andparse_pagesobuild_anchor_map_from_markdownreceives the correct prefixed title__main__.pyin favor of correct upfront titleidna3.13 → 3.15 (fixes GHSA-65pc-fj4g-8rjx)Tests
TestAnchorWithTitlePrefixcovering: prefix anchor generation, no-prefix unchanged behavior, multiple headings