mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-04-22 18:47:33 +00:00
Adjust code to new options structure
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
388ffa198f
commit
5893680e53
1 changed files with 8 additions and 9 deletions
|
@ -8,13 +8,12 @@ import MarkdownIt from 'markdown-it'
|
|||
import anchor from 'markdown-it-anchor'
|
||||
|
||||
export const headlineAnchors: MarkdownIt.PluginSimple = (markdownIt) => {
|
||||
const options: anchor.AnchorOptions = {
|
||||
permalink: true,
|
||||
permalinkBefore: true,
|
||||
permalinkClass: 'heading-anchor text-dark',
|
||||
permalinkSymbol: '<i class="fa fa-link"></i>',
|
||||
permalinkHref: (slug: string): string => `#${slug}`
|
||||
}
|
||||
|
||||
anchor(markdownIt, options)
|
||||
anchor(markdownIt, {
|
||||
permalink: anchor.permalink.ariaHidden({
|
||||
symbol: '<i class="fa fa-link"></i>',
|
||||
class: 'heading-anchor text-dark',
|
||||
renderHref: (slug: string): string => `#${slug}`,
|
||||
placement: 'before'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue