Closed jamesplease closed 2 years ago
The permalinkSymbol
trick is a pretty good workaround! I wouldn't want to make
the default since it would be quite a breaking change, but I just released v8.6.1 with a way to customize the space
option, so you can now do this:
const anchor = require('markdown-it-anchor')
const md = require('markdown-it')()
md.use(anchor, {
permalink: anchor.permalink.linkInsideHeader({
permalink: true,
space: ' ',
})
})
Sorry for the late reply!
Thanks so much @valeriangalliat !
Hi! Thanks for the great library. I noticed that regular spaces are used, which means that the permalink can be wrapped separately from the header text. If this is switched to a non-breaking space (
) then it ensures that the final word and the permalink will always appear side-to-side.For folks who may be reading this issue, this can currently be solved in user-land as follows: