Adjust code to new options structure

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-06-19 21:51:25 +02:00
parent 388ffa198f
commit 5893680e53

View file

@ -8,13 +8,12 @@ import MarkdownIt from 'markdown-it'
import anchor from 'markdown-it-anchor' import anchor from 'markdown-it-anchor'
export const headlineAnchors: MarkdownIt.PluginSimple = (markdownIt) => { export const headlineAnchors: MarkdownIt.PluginSimple = (markdownIt) => {
const options: anchor.AnchorOptions = { anchor(markdownIt, {
permalink: true, permalink: anchor.permalink.ariaHidden({
permalinkBefore: true, symbol: '<i class="fa fa-link"></i>',
permalinkClass: 'heading-anchor text-dark', class: 'heading-anchor text-dark',
permalinkSymbol: '<i class="fa fa-link"></i>', renderHref: (slug: string): string => `#${slug}`,
permalinkHref: (slug: string): string => `#${slug}` placement: 'before'
} })
})
anchor(markdownIt, options)
} }