hedgedoc/src/components/markdown-renderer/markdown-it-plugins/headline-anchors.ts
Philip Molares 0670cddb0b
markdown-it-configurator (#626)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
Co-authored-by: Erik Michelson <github@erik.michelson.eu>
2020-10-08 22:24:42 +02:00

12 lines
364 B
TypeScript

import MarkdownIt from 'markdown-it'
import anchor from 'markdown-it-anchor'
export const headlineAnchors: MarkdownIt.PluginSimple = (markdownIt) => {
// noinspection CheckTagEmptyBody
anchor(markdownIt, {
permalink: true,
permalinkBefore: true,
permalinkClass: 'heading-anchor text-dark',
permalinkSymbol: '<i class="fa fa-link"></i>'
})
}