Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AnchorLinks don't work properly #5100

Merged
merged 2 commits into from
Mar 11, 2023
Merged

fix: AnchorLinks don't work properly #5100

merged 2 commits into from
Mar 11, 2023

Conversation

SEWeiTung
Copy link
Contributor

This fixture mainly focuses on two bugs:

  1. For Heading <h1>, it doesn't render as what we see for "h2" , "h3"..,and the "id" is always null. So the solution is to render the the children (here it must be a string) and return it in default.

【Before】
WrongForH1

【After】
CorrectForH1

  1. For some very very long English titles or non-English titles in md, the generated anchor name in default will be very hard to read/write in md files if we want to refer. What we used to do is to give it an alian name in short, Take Chinese generated HTML files will be a good example to explain.

【Before】
WrongForChineseAnchorLink

【After】
CorrectForChineseAnchorLink

@SEWeiTung SEWeiTung changed the title fix: AnchorLinks doesn't work properly fix: AnchorLinks don't work properly Mar 10, 2023
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

Overall looks good to me! I added just two minor suggestions. Thank you!

This fixture mainly focuses on two bugs:

1. For Heading <h1>, it doesn't render as what we see for "h2" ,
   "h3"..,and the "id" is always null. So the solution is to render the
   the children (here it must be a string) and return it in default.

2. For very long English titles or non-English titles in md files,
the generated anchor name in default will be very hard to read/write in
md files if we want to refer. What we used to do is to give it an alian
name in short, Take Chinese generated HTML files will be a good example
to explain.
@SEWeiTung SEWeiTung added this pull request to the merge queue Mar 11, 2023
Merged via the queue into nodejs:main with commit fbe760e Mar 11, 2023
@SEWeiTung SEWeiTung deleted the fixForAnchorLinks branch March 11, 2023 02:07
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