Skip to content

[Fix]: Fix TOC links in preview navigation#123

Open
StarDustNova-57 wants to merge 1 commit into
Mohit-368:mainfrom
StarDustNova-57:fix/toc-preview-links
Open

[Fix]: Fix TOC links in preview navigation#123
StarDustNova-57 wants to merge 1 commit into
Mohit-368:mainfrom
StarDustNova-57:fix/toc-preview-links

Conversation

@StarDustNova-57
Copy link
Copy Markdown

Description

This PR fixes the Table of Contents links in the README preview panel.

Previously, clicking links such as Description, Features, Installation, and other entries in the Table of Contents always redirected to the top of the preview instead of navigating to the corresponding section.

Changes Made

  • Added matching id attributes to generated heading tags (#, ##, and ###).
  • Updated link conversion logic so internal anchor links (e.g., #description) no longer use target="_blank".
  • Preserved target="_blank" behavior for external links.
  • Verified that all Table of Contents links now navigate to the correct sections within the preview panel.

Testing

  • Generated a README containing multiple sections.
  • Clicked all links in the Table of Contents.
  • Confirmed that each link scrolls to the correct section.
  • Verified that external links still open in a new tab.

Issue Fixed

Closes #84

@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

Deploy Preview for makeareadme failed.

Name Link
🔨 Latest commit d2d1577
🔍 Latest deploy log https://app.netlify.com/projects/makeareadme/deploys/6a084b05da00fd000862c6ee

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview Table of Contents links do not navigate to corresponding sections

1 participant