Skip to content

fix(LinkDialog): Fix anchor regex to handle hyphens in URL fragments - #3683

Merged
tvdeyen merged 1 commit into
mainfrom
fix/link_dialog_anchor_regex
Feb 17, 2026
Merged

fix(LinkDialog): Fix anchor regex to handle hyphens in URL fragments#3683
tvdeyen merged 1 commit into
mainfrom
fix/link_dialog_anchor_regex

Conversation

@tvdeyen

@tvdeyen tvdeyen commented Feb 17, 2026

Copy link
Copy Markdown
Member

What is this pull request for?

The fragment-stripping regex used \w+ which only matches word characters and fails on hyphens, causing double hash anchors (e.g. /page#my-section#new-section). The new ANCHOR_REGEX covers all RFC 3986 unreserved characters ([\w.~-]).

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

The fragment-stripping regex used \w+ which only matches word characters
and fails on hyphens, causing double hash anchors (e.g. /page#my-section#new-section).
The new ANCHOR_REGEX covers all RFC 3986 unreserved characters ([\w.~-]).
@tvdeyen tvdeyen added the bug label Feb 17, 2026
@tvdeyen
tvdeyen requested a review from a team as a code owner February 17, 2026 07:56
@tvdeyen tvdeyen added backport-to-7.4-stable Needs to be backported to 7.4-stable backport-to-8.0-stable Needs to be backported to 8.0-stable backport-to-8.1-stable Needs to be backported to 8.1-stable labels Feb 17, 2026
@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.46%. Comparing base (3d92382) to head (f6467a9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3683   +/-   ##
=======================================
  Coverage   97.46%   97.46%           
=======================================
  Files         314      314           
  Lines        8288     8288           
=======================================
  Hits         8078     8078           
  Misses        210      210           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alchemycms-bot

Copy link
Copy Markdown

💚 All backports created successfully

Status Branch Result
7.4-stable
8.0-stable
8.1-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-7.4-stable Needs to be backported to 7.4-stable backport-to-8.0-stable Needs to be backported to 8.0-stable backport-to-8.1-stable Needs to be backported to 8.1-stable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant