Skip to content

escape anchor fragment in shadow DOM name selector#69151

Open
rootvector2 wants to merge 1 commit into
angular:mainfrom
rootvector2:scroller-anchor-css-escape
Open

escape anchor fragment in shadow DOM name selector#69151
rootvector2 wants to merge 1 commit into
angular:mainfrom
rootvector2:scroller-anchor-css-escape

Conversation

@rootvector2
Copy link
Copy Markdown
Contributor

findAnchorFromDocument drops the raw url fragment into [name="${target}"] for the shadow DOM lookup, so a fragment like a"]),(* (reachable through the router when anchorScrolling is on) breaks out of the attribute selector and makes querySelector throw or match unrelated nodes, and it also breaks legitimate anchor names containing a quote; wrap it in CSS.escape so the value stays inside the selector.

@pullapprove pullapprove Bot requested a review from atscott June 4, 2026 12:51
@atscott atscott added the target: patch This PR is targeted for the next patch release label Jun 4, 2026
@atscott
Copy link
Copy Markdown
Contributor

atscott commented Jun 4, 2026

Could you please update the commit message to follow the guidelines (outlined in the failing lint check)

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

Labels

target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants