-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
does not add anchors to headings using GitHub’s algorithm #11
Comments
We can’t do that easily, unfortunately, to solve it we’d need to include a whole HTML parser. That is a very intensive task. If you’re going to HTML, instead, you can use rehype-slug. Alternatively, you can set And lastly, you could also not use HTML in headings ;) HTML in Markdown has many downsides. |
Btw, thanks for distilling the problem down so much! That makes me able to answer quickly. But on the other hand, maybe there is a bigger question you have, that I can also answer? |
Actually i don't mind with current behavior. Just opening up this issue just in case someone will open up an issue in our repo saying this. When they do it, I will tell them to see this issue 😆 Thanks for the great work |
Ahh alright, good! Yeah, it’s good that this is documented 👍 Thanks Endi! |
Subject of the issue
remark-slug does not add anchors to headings using GitHub’s algorithm.
This probably got to do with
toString
from https://github.com/syntax-tree/mdast-util-to-stringYour environment
N/A. Does not matter.
Steps to reproduce
Example you have markdown
Use runkit for easy reproduction
https://runkit.com/endiliey/5dd56d8045205a0013aec93d
Expected behaviour
Slug should be like GitHub https://gist.github.com/endiliey/4516bbf630b0f34eeabe8900733cfbf6#-foo
-foo
and-foo-1
Actual behaviour
Slug is
a-namefooa-foo
anda-namefooa-foo-1
The text was updated successfully, but these errors were encountered: