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

Not able to pass id's to heading tag #380

Closed
mayankbytes opened this issue Jan 11, 2020 · 4 comments
Closed

Not able to pass id's to heading tag #380

mayankbytes opened this issue Jan 11, 2020 · 4 comments
Labels
👀 no/external This makes more sense somewhere else 🙋 no/question This does not need any changes

Comments

@mayankbytes
Copy link

mayankbytes commented Jan 11, 2020

"### My Great Heading {#custom-id} "

should be converted to following according Markdown document

"< h3 id="custom-id">'My Great Heading </h3 >"

but using react-markdown, it is getting converted to
"< h3 > My Great Heading {#custom-id}</h3 >"

@mayankbytes
Copy link
Author

@rexxars - Do we have any way by which I could achieve this?

@bj00rn
Copy link

bj00rn commented Jan 23, 2020

#384

@viktor-yakubiv
Copy link

viktor-yakubiv commented Feb 21, 2020

I found:

  • getCoreProps does not pass additional props but only extracts a source position
  • Heading renderer does not pass additional props neither

As a solution I would either split props or pass the rest to renderer. Although, I see no additional props passed by plugins.

@ChristianMurphy
Copy link
Member

This is not a feature of markdown, and as such would not be supported in core.
However it can be added through a remark plugin by adding https://github.com/imcuttle/remark-heading-id

@ChristianMurphy ChristianMurphy added 🙋 no/question This does not need any changes 👀 no/external This makes more sense somewhere else labels Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 🙋 no/question This does not need any changes
Development

No branches or pull requests

4 participants