Skip to content

Fix #2343: duplicate Example headings cause incorrect scroll and highlight#2353

Open
Surajiitmjnu wants to merge 4 commits intojson-schema-org:mainfrom
Surajiitmjnu:#2343
Open

Fix #2343: duplicate Example headings cause incorrect scroll and highlight#2353
Surajiitmjnu wants to merge 4 commits intojson-schema-org:mainfrom
Surajiitmjnu:#2343

Conversation

@Surajiitmjnu
Copy link
Copy Markdown
Contributor

@Surajiitmjnu Surajiitmjnu commented Mar 18, 2026

What kind of change does this PR introduce?

Bugfix

Issue Number:

Screenshots/videos:

suraj_second.mp4

Summary
This PR fixes an issue where multiple "Example" headings generated identical anchor IDs, causing incorrect scroll behavior and multiple headers being highlighted simultaneously.

Previously:

  • Clicking on the second "Example" section scrolled to the first one
  • Multiple headers were highlighted at the same time

Fix:

  • Updated the headings to generate unique slugs by making them distinct
  • This ensures correct navigation and highlights only the active section

Does this PR introduce a breaking change?
No

Checklist

  • Read, understood, and followed the contributing guidelines.

@Surajiitmjnu Surajiitmjnu requested a review from a team as a code owner March 18, 2026 09:11
@github-project-automation github-project-automation bot moved this to Ready to review in PR - Triage Group Mar 18, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview 1bb8ad4

@Surajiitmjnu Surajiitmjnu changed the title #2343 Fix #2343: duplicate Example headings cause incorrect scroll and highlight Mar 18, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dbfaf31) to head (1bb8ad4).
⚠️ Report is 103 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2353   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          633       672   +39     
  Branches       196       211   +15     
=========================================
+ Hits           633       672   +39     

☔ 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.

@Surajiitmjnu
Copy link
Copy Markdown
Contributor Author

Hi @Utkarsh-123github sir,
Could you please review this PR and let me know if any further improvements or changes are needed?

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

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

🐛 Bug: HClicking on Example section header scrolls to the first Example section and highlights multiple headers

1 participant