Skip to content

fix(metadata): strip directory prefix when converting nested .md link to .html#768

Open
TusharThakur04 wants to merge 1 commit intonodejs:mainfrom
TusharThakur04:fix/markdown-to-html-link
Open

fix(metadata): strip directory prefix when converting nested .md link to .html#768
TusharThakur04 wants to merge 1 commit intonodejs:mainfrom
TusharThakur04:fix/markdown-to-html-link

Conversation

@TusharThakur04
Copy link
Copy Markdown
Contributor

Description

This PR reinforce the link conversion logic for nested .md files by stripping the directory prefix.

Validation

before :

Screencast.from.2026-04-14.05-00-18.webm

after :

Screencast.from.2026-04-14.04-36-15.webm

Related Issues

n/a

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@TusharThakur04 TusharThakur04 requested a review from a team as a code owner April 13, 2026 23:35
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Apr 13, 2026 11:35pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 13, 2026

PR Summary

Low Risk
Low risk: small, localized change to markdown-link normalization plus added unit coverage; main risk is unintended link rewriting if some docs relied on preserving subpaths.

Overview
API doc link normalization now converts Markdown links like namespaces/foo.md to foo.html (using basename) while still preserving any #fragment.

Adds unit tests covering nested .md links and fragment preservation to prevent regressions.

Reviewed by Cursor Bugbot for commit d2522a7. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this?

@TusharThakur04
Copy link
Copy Markdown
Contributor Author

TusharThakur04 commented Apr 15, 2026

earlier a markdown link such as namespaces/compileBooleanMatcher.md was converted to
namespaces/compileBooleanMatcher.html
but all pages are generated at root -- compileBooleanMatcher.html
so we need namespaces/compileBooleanMatcher.md to be converted to compileBooleanMatcher.html instead of namespaces/compileBooleanMatcher.html

this pr strips the directory prefix

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.

2 participants