-
Notifications
You must be signed in to change notification settings - Fork 41
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
Why "id" attribute is being generated on heading elements? #54
Comments
I thought this was standard markdown. https://github.com/gitlabhq/gitlabhq/blob/master/doc/markdown/markdown.md#headers |
I did a little more digging. I was always under the assumption this was standard markdown behavior. Grunt markdown uses https://github.com/chjj/marked It might be part of the GFM option. You can pass options to marked using the |
I don't see any option for disabling auto generation of id attributes on headings, do you? |
No I don't you might not be able to disabled it. https://github.com/chjj/marked/blob/master/lib/marked.js#L788 Thats where they are adding the ID. I don't seen any obvious way of disabling that behavior. |
I don't think this is part of standard markdown. John Gruber's markdown samples and his Dingus app do not generate such id on headings when converting markdown to html, nor does Github. |
Yea not sure where this came from. Marked is doing it and since i am using marked there is little I can do about it. Looks like there is some discussion on this thread markedjs/marked#515 |
Others have also complained about this: Marked's development seems to be stalled with 180 open issues. |
Have you looked into this? https://github.com/evilstreak/markdown-js |
Does it support GFM? GFM is really important for a lot of the common uses of grunt markdown. |
Not yet, but he is working on it. You can voice your support for it here: |
If you really want to remove the ids you could do it in |
I think I can live with it. Thanks for your help. |
Wouldn't you be able to override marked's Renderer and override it's heading handler? |
@dnutels yes I could but right now I don't extend marked at all. If I start to extend marked the plugin will become coupled to marked. I like to keep the coupling loose so if I find a better markdown parser I should be able to swap it easily. |
{
...
markdown: {
heading: function() {...}
}
} |
it looks like id is being added to headings only. Use a
|
I see that this line of markdown:
This is a test of GFM for javascript
once converted to HTML becomes this:
Which option is responsible for auto-generating id in heading elements and how can this be turned off?
The text was updated successfully, but these errors were encountered: