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
Feature request: container option for linkAfterHeader #110
Comments
Hey! Seems like a common demand for const anchor = require('markdown-it-anchor')
const md = require('markdown-it')()
md.use(anchor, {
permalink: anchor.permalink.linkAfterHeader({
style: 'visually-hidden',
assistiveText: title => `Permalink to “${title}”`,
visuallyHiddenClass: 'visually-hidden'
visuallyHiddenClass: 'visually-hidden',
wrapper: ['<div class="wrapper">', '</div>']
})
}) <div class="wrapper">
<h2 id="title">Title</h2>
<a class="header-anchor" href="#title">
<span class="visually-hidden">Permalink to “Title”</span>
<span aria-hidden="true">#</span>
</a>
</div> Does this looks like a reasonable API? Cheers! |
Yes, that was exactly what I was hoping for—thanks! |
Awesome, published with v8.5.0! Thank you for the Ko-fi ❤️ |
Thank you! 🏅 |
I'm late using this, but it rocks! Thanks @valeriangalliat |
Hi Val,
I noticed that to add a container around the outputted HTML when using
linkAfterHeader
I'd need to implement my own render function. Would it make sense to provide an option for passing in a container?Best,
Jan
The text was updated successfully, but these errors were encountered: