Repository navigation
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2579 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 31 31
Lines 719 719
Branches 223 223
=========================================
Hits 719 719 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@playlikeboy quick q. ids for quoted inline code keep the quotes now ( |
playlikeboy
left a comment
There was a problem hiding this comment.
Looks great! Keeping quotes is definitely the right call since it stays consistent with how plain-text headings are slugified across the rest of the site. Tested locally and on the Cloudflare preview — all the TOC links scroll to the right headings now. Thanks for putting this together!
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
shivaminfo1
left a comment
There was a problem hiding this comment.
Thanks @drishtyraghav0001, nice cleanup of the heading slug logic and solid test coverage. LGTM!
Posted from the wrong account by mistake.
vtushar06
left a comment
There was a problem hiding this comment.
Thanks @drishtyraghav0001, nice cleanup of the heading slug logic and solid test coverage. LGTM!
What kind of change does this PR introduce?
Bugfix
Issue Number:
Screenshots/videos:
n/a, heading ids only. checked in the built html that the draft-06 release notes heading id now matches its TOC link
If relevant, did you update the documentation?
no
Summary
slugifyMarkdownHeadlinewas dropping every child that wasn't a plain string, so headings with inline code, bold, italic or links got cut-off ids and the TOC links didn't scroll anywhere. it now pulls text out of nested children recursively (strings, numbers, arrays, react elements, md nodes). the[#custom-id]fragment still works the same.the two draft-06 release notes pages had hand written TOC links pointing at the old truncated ids, so I updated those 7 links to the new ids. I scanned all headings under
pages/and 19 ids changed, all headings with formatting in them. no other links in the repo pointed at the old ids.added tests in
cypress/components/slugifyMarkdownHeadline.cy.tsxand one inHeadlines.cy.tsx. lint, typecheck, build and the full component suite pass locally.Does this PR introduce a breaking change?
no. external deep links to the old truncated ids on those 19 headings would stop matching, but they were broken from the TOC anyway
Checklist