Skip to content

PMM-15369 - Fix .md→.html link rewrite when link has a fragment - #566

Merged
ondrejpatocka merged 2 commits into
mainfrom
PMM-7---Improve-RN-formatting
Sep 4, 2026
Merged

PMM-15369 - Fix .md→.html link rewrite when link has a fragment#566
ondrejpatocka merged 2 commits into
mainfrom
PMM-7---Improve-RN-formatting

Conversation

@ondrejpatocka

Copy link
Copy Markdown
Contributor

Problem

format-release-notes converts relative .md links to absolute
.html links pointing at docs.percona.com. The suffix check ran on
the fully-resolved URL string, so any link with a #fragment after
.md (e.g. QAN-realtime-analytics.md#export-rta-data) no longer
ended in .md and the rewrite was silently skipped, leaving a dead
.md#... link in published release notes.

Confirmed still present in the committed 3.9.0 release notes
(QAN-realtime-analytics.md#export-data), which is why this
previously required manual fixing after every make format-release-notes run.

Fix

Check the .md suffix on the resolved URL's Path component instead
of the serialized string, so the fragment/query no longer interferes
with the check.

@JNKPercona

Copy link
Copy Markdown
Contributor
Test name Status
api-tests passed

Comment thread cmd/format-release-notes/formatter.go
JiriCtvrtka
JiriCtvrtka previously approved these changes Sep 1, 2026
Co-authored-by: Jiří Čtvrtka <62988319+JiriCtvrtka@users.noreply.github.com>
@JNKPercona

Copy link
Copy Markdown
Contributor
Test name Status
api-tests passed

@JiriCtvrtka JiriCtvrtka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocking, because they existed even before:

  • cmd/format-release-notes/formatter.go:85 — a bare in-page anchor a is treated as a relative link and rewritten to https://docs.percona.com/percona-monitoring-and-management/3//#section, turning an intra-document jump into a cross-page link to the docs root. extractRelativeURL only checks !IsAbs(); it doesn't exclude fragment-only targets. Since this PR is specifically about fragments, it's a natural add-on: skip when target.Path == "" && target.Fragment != "".
  • cmd/format-release-notes/formatter.go:76 — the deliberate 3// double-slash base leaks into output for targets without a ../ prefix (QAN.md#f → 3//QAN.html#f). Cosmetic; docs likely tolerate it.

@ondrejpatocka
ondrejpatocka merged commit 5ebda93 into main Sep 4, 2026
3 checks passed
@ondrejpatocka
ondrejpatocka deleted the PMM-7---Improve-RN-formatting branch September 4, 2026 05:56
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.

4 participants