fix: resolve Table of Contents smooth scroll navigation (#169)#170
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a9a54f6 to
24b2c6e
Compare
Deploying markdown-viewer with
|
| Latest commit: |
fc5e16f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://641e71d4.markdown-viewer.pages.dev |
| Branch Preview URL: | https://fix-toc-scrolling-169.markdown-viewer.pages.dev |
Deploying markdownviewer with
|
| Latest commit: |
fc5e16f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3ea00621.markdownviewer.pages.dev |
| Branch Preview URL: | https://fix-toc-scrolling-169.markdownviewer.pages.dev |
24b2c6e to
d3af730
Compare
d3af730 to
d7ae590
Compare
d7ae590 to
fc5e16f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves the issue where clicking Table of Contents (TOC) anchor links updates the URL hash but fails to scroll the preview page to the target heading section (fixes #169).
Root Causes
idattributes by default, rendering headers without DOM anchors..preview-pane) rather than the document body.Changes Implemented
renderer.headingin bothscript.jsandpreview-worker.jsto assign standard GFM-compliant IDs to all headings..preview-panescroll container to it.desktop-app/resources/js/).test_toc_scrolling.spec.js) confirming that TOC clicks correctly transition the.preview-panescroll offset.Related Issues
Closes #169