|
|
@ -14,6 +14,7 @@ import { extractHeaderPlugin } from './plugins/header'
|
|
|
|
import { Header } from '../shared'
|
|
|
|
import { Header } from '../shared'
|
|
|
|
import anchor, { AnchorOptions } from 'markdown-it-anchor'
|
|
|
|
import anchor, { AnchorOptions } from 'markdown-it-anchor'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const attrs = require('markdown-it-attrs')
|
|
|
|
const emoji = require('markdown-it-emoji')
|
|
|
|
const emoji = require('markdown-it-emoji')
|
|
|
|
const toc = require('markdown-it-table-of-contents')
|
|
|
|
const toc = require('markdown-it-table-of-contents')
|
|
|
|
|
|
|
|
|
|
|
@ -23,6 +24,11 @@ export interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
|
anchor?: {
|
|
|
|
anchor?: {
|
|
|
|
permalink?: AnchorOptions['permalink']
|
|
|
|
permalink?: AnchorOptions['permalink']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
attrs?: {
|
|
|
|
|
|
|
|
leftDelimiter?: string
|
|
|
|
|
|
|
|
rightDelimiter?: string
|
|
|
|
|
|
|
|
allowedAttributes?: string[]
|
|
|
|
|
|
|
|
}
|
|
|
|
// https://github.com/Oktavilla/markdown-it-table-of-contents
|
|
|
|
// https://github.com/Oktavilla/markdown-it-table-of-contents
|
|
|
|
toc?: any
|
|
|
|
toc?: any
|
|
|
|
externalLinks?: Record<string, string>
|
|
|
|
externalLinks?: Record<string, string>
|
|
|
@ -64,6 +70,12 @@ export const createMarkdownRenderer = (
|
|
|
|
...options.externalLinks
|
|
|
|
...options.externalLinks
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.use(attrs, {
|
|
|
|
|
|
|
|
leftDelimiter: '{',
|
|
|
|
|
|
|
|
rightDelimiter: '}',
|
|
|
|
|
|
|
|
allowedAttributes: [],
|
|
|
|
|
|
|
|
...options.attrs
|
|
|
|
|
|
|
|
})
|
|
|
|
// 3rd party plugins
|
|
|
|
// 3rd party plugins
|
|
|
|
.use(anchor, {
|
|
|
|
.use(anchor, {
|
|
|
|
slugify,
|
|
|
|
slugify,
|
|
|
|