-
Notifications
You must be signed in to change notification settings - Fork 73
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
Reverse level #27
Comments
Makes sense. Initially my thought was mostly to exclude But it think it would be a good idea to make I'll give it a shot over the week-end. |
Thats great, an array with the levels where you want to have ids/anchors. My issue is because i have headings like: <h4><code>options</code></h4>
<ul>
<li>active: true</li>
<li>...</li>
</ul> And because my heading doesn't contain text, it's generated like |
Oh, interesting, I'd also consider this as a bug, the ID should be a slugified version of the code too. I'm looking into this. |
Hmm, I just tested the following: equal(
md({ html: true }).use(anchor).render('#### <code>options</code>'),
'<h4 id="options"><code>options</code></h4>\n'
) And it actually passes. What versions of markdown-it and markdown-it-anchor are you using? Edit: ha, the following indeed have empty ID, I need to fix this. equal(
md().use(anchor).render('#### `options`'),
'<h4 id="options"><code>options</code></h4>\n'
) |
I fixed both issues; the inline code is now also used to generate the ID, and you can pass an array of header levels to select in the It's published as of 4.0.0. Note that I also dropped Babel support in 4.0.0 so this module only works with a Node version with ES6 support. |
Works great, thanks! |
Doesn't
level
works as opposite as its supposed to?For example, i want to give an id attribute to my main headers, h1, h2 and h3, but i can't use the
level
attribute to control that. How i'm supposed to exclude the h4 ones? It should work the opposite :/level
: 3 <- minimum header level of 3 to apply the functionality.But right now that's just adding the attributes to h3-h6 tags, which is... weird.
The text was updated successfully, but these errors were encountered: