Skip to content

fix: normalize headings with markdown link targets - #14

Merged
riki137 merged 2 commits into
mainfrom
fix/link-target-headings
Aug 6, 2026
Merged

fix: normalize headings with markdown link targets#14
riki137 merged 2 commits into
mainfrom
fix/link-target-headings

Conversation

@riki137

@riki137 riki137 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Changelog headings that carry a markdown link target are now recognized and normalized:

  • reference-style ## [Unreleased][unreleased]
  • inline ## [Unreleased](unreleased)

This applies to both the Unreleased heading and versioned sections (e.g. ## [1.2.3](url) - 2025-01-01). The link target is dropped on parse; link references are regenerated on release.

Replaces the 1.5.0 handling of the reversed ## (Unreleased)[unreleased] shape, which no tool emits.

riki137 added 2 commits August 6, 2026 12:59
Recognize and normalize changelog headings that carry a markdown link
target — reference-style `## [Unreleased][unreleased]` and inline
`## [Unreleased](unreleased)` — on both the Unreleased and versioned
sections. SECTION_RE now tolerates an optional `[ref]`/`(url)` after the
bracketed heading text; the target is discarded since link refs are
regenerated on release.

Replaces the 1.5.0 handling of the reversed `## (Unreleased)[unreleased]`
shape, which no tool emits.
Split the combined heading regex into three simpler regexes to cut
cyclomatic complexity below Sonar's threshold and use \d instead of
[0-9]. Parameterize the three near-identical unreleased-heading tests
into one test.each block.
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@riki137
riki137 merged commit 75bcb71 into main Aug 6, 2026
3 checks passed
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