Rewriting Relative Markdown Links and Heading Anchors for Confluence Storage XHTML
Updated
POSIX Path Normalization & Traversal Guards
Every outbound Markdown link is normalized against the directory of the source Markdown file. Links that traverse above the repository root (../../outside.md) or target missing files are flagged as compiler diagnostics during preflight so broken links never reach Confluence.
Source file: docs/guides/quickstart.md
Raw link: ../setup.md#install
Normalized: docs/setup.md (anchor: "install")
Target page: "Setup & Provisioning Guide" (Space: ENG)
Deterministic Attachment Naming Across Subdirectories
Because Confluence attachments live in a flat namespace per page, two images named diagram.png in different folders could collide. DocBrancher prefixes attachment filenames deterministically from their normalized repository path and verifies their SHA-256 digest.
Frequently Asked Questions
What happens if a Markdown file links to an external HTTPS URL?
External HTTPS links are preserved as standard escaped anchor tags, while unsafe schemes such as javascript:, data:, and vbscript: are neutralized by the compiler.