Preserve link text in sidebar heading navigation #3270
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.24) × (1 − Review Confidence (0.91)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.24 · 18 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.93 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.176
Real PR Conversation Timeline
4 items
This is the wrong fix. The sidebar renderer should only keep the <a> text, and remove the tag. It should not be done in the JS.
Changes Requested
Requested changes.
Reminder, once the PR becomes ready for a review, use @rustbot ready.
GuillaumeGomez
saiv0n
Fixes #3260
Fixes #3126
When a heading contains a link (e.g. `
## Like [this](example.com)or## fzf),add_header_links()wraps the heading contents in<a class="header">, which produces nested<a>tags. Browsers automatically close the outer<a class="header">before the inner link, leaving the link and any trailing text as siblings under the heading element rather than children ofheader.children[0].Because toc.js
calledfilterHeader(header.children[0], a), anything from the first link onward was dropped from the sidebar TOC (producing an empty anchor when the heading starts with a link).This passes header
itself tofilterHeaderand unwraps bothmarkandaelements (preserving their child nodes such as<code>), so the sidebar entry keeps the full heading content without nesting<a>tags. Added assertions toheading-nav-markup.goml` covering plain links, formatted links, and trailing text.