mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04: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'
|
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)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue