@ -12,18 +12,16 @@ import { preWrapperPlugin } from './plugins/preWrapper'
import { linkPlugin } from './plugins/link'
import { linkPlugin } from './plugins/link'
import { extractHeaderPlugin } from './plugins/header'
import { extractHeaderPlugin } from './plugins/header'
import { Header } from '../shared'
import { Header } from '../shared'
import anchor , { AnchorOptions } from 'markdown-it-anchor'
const emoji = require ( 'markdown-it-emoji' )
const emoji = require ( 'markdown-it-emoji' )
const anchor = require ( 'markdown-it-anchor' )
const toc = require ( 'markdown-it-table-of-contents' )
const toc = require ( 'markdown-it-table-of-contents' )
export interface MarkdownOptions extends MarkdownIt . Options {
export interface MarkdownOptions extends MarkdownIt . Options {
lineNumbers? : boolean
lineNumbers? : boolean
config ? : ( md : MarkdownIt ) = > void
config ? : ( md : MarkdownIt ) = > void
anchor ? : {
anchor ? : {
permalink? : boolean
permalink? : AnchorOptions [ 'permalink' ]
permalinkBefore? : boolean
permalinkSymbol? : string
}
}
// https://github.com/Oktavilla/markdown-it-table-of-contents
// https://github.com/Oktavilla/markdown-it-table-of-contents
toc? : any
toc? : any
@ -70,10 +68,7 @@ export const createMarkdownRenderer = (
. use ( emoji )
. use ( emoji )
. use ( anchor , {
. use ( anchor , {
slugify ,
slugify ,
permalink : true ,
permalink : anchor.permalink.ariaHidden ( { } ) ,
permalinkBefore : true ,
permalinkSymbol : '#' ,
permalinkAttrs : ( ) = > ( { 'aria-hidden' : true } ) ,
. . . options . anchor
. . . options . anchor
} )
} )
. use ( toc , {
. use ( toc , {