-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Support html anchors #1
Comments
Yup, it doesn’t. It supports github, npm, and other “heading” auto id’s. mdast doesn’t parse HTML (markdown doesn’t care if HTML is in real, valid, &c.). HTML can be a mess: in fact, the point of mdast is to not only think about compiling to HTML, but also support other systems (e.g., man pages or react), which all simply discard HTML. To add this, I recommend creating something that parses HTML nodes and adds the first found It’s not really on (the top of) my TODO list, but |
Well, this is not about parsing html, but about parsing markdown the |
I don’t think it’s mdast-validate-links which should parse HTML, just like I don’t think it’s mdast-validate-links job to detect slugs (that’s mdast-slug). That should be another module, which I’m currently not willing to write (sorry). It is mdast-validate-links’s place to ensure other modules can interact with it, by exposing The fact that markdown doesn’t expose anchors means HTML anchors are no portable (and probably not safe) to other formats. This is part of why I’m not that interested in working on this. Also, regarding “just parse these tags”, how about I can provide help if you’d be interested in building this though. |
I don't know what the word "slug" means, but maybe indeed I mean that mdast-slug should parse those tags in markdown. Indeed parsing the possible anchor variations can be horrible (so maybe regex is not a good approach). I am not sure whether html anchors are generally not portable to other formats, this really depends on any given tools willingness to handle html anchors (I need to check pandoc anyway). If everbody uses them in their markdown, tools will follow. |
Slug. A more simple approach would be to only support a single HTML element, with content set to the empty string, with one attribute, namely But again, I’m not going to create it. I can help you with setting up a plugin/utility though! |
ok, wish I had the time, but have not. Closing as invalid. |
For now I’m reopening, just to reminded that this plugin should support non-headings, Thanks for the idea! 👍 |
Hi,
I beleve this only valdate simple header links, not html anchor links, right?
http://stackoverflow.com/questions/6695439/how-do-you-create-link-to-a-named-anchor-in-multimarkdown
Example:
The text was updated successfully, but these errors were encountered: