|
|
@ -34,6 +34,7 @@ export type ThemeOptions =
|
|
|
|
|
|
|
|
|
|
|
|
export interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
|
export interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
|
lineNumbers?: boolean
|
|
|
|
lineNumbers?: boolean
|
|
|
|
|
|
|
|
preConfig?: (md: MarkdownIt) => void
|
|
|
|
config?: (md: MarkdownIt) => void
|
|
|
|
config?: (md: MarkdownIt) => void
|
|
|
|
anchor?: anchorPlugin.AnchorOptions
|
|
|
|
anchor?: anchorPlugin.AnchorOptions
|
|
|
|
attrs?: {
|
|
|
|
attrs?: {
|
|
|
@ -76,10 +77,14 @@ export const createMarkdownRenderer = async (
|
|
|
|
logger
|
|
|
|
logger
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
...options
|
|
|
|
...options
|
|
|
|
}) as MarkdownRenderer
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
md.linkify.set({ fuzzyLink: false })
|
|
|
|
md.linkify.set({ fuzzyLink: false })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (options.preConfig) {
|
|
|
|
|
|
|
|
options.preConfig(md)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// custom plugins
|
|
|
|
// custom plugins
|
|
|
|
md.use(componentPlugin)
|
|
|
|
md.use(componentPlugin)
|
|
|
|
.use(highlightLinePlugin)
|
|
|
|
.use(highlightLinePlugin)
|
|
|
|