fix: switch to `markdown-it-toc-done-right` (#388) (#660)

fix #388
pull/665/head
Divyansh Singh 3 years ago committed by GitHub
parent 6028cacb81
commit 7d89b61b92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -121,8 +121,8 @@ interface MarkdownOptions extends MarkdownIt.Options {
allowedAttributes?: string[]
}
// markdown-it-table-of-contents cplugin options
// https://github.com/Oktavilla/markdown-it-table-of-contents
// markdown-it-toc-done-right plugin options
// https://github.com/nagaozen/markdown-it-toc-done-right
toc?: any
// Configure the Markdown-it instance to fully customize

@ -403,8 +403,8 @@ module.exports = {
permalink: anchor.permalink.headerLink()
},
// options for markdown-it-table-of-contents
toc: { includeLevel: [1, 2] },
// options for markdown-it-toc-done-right
toc: { level: [1, 2] },
config: (md) => {
// use more markdown-it plugins!

@ -124,7 +124,7 @@
"markdown-it-attrs": "^4.1.3",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.0",
"markdown-it-table-of-contents": "^0.6.0",
"markdown-it-toc-done-right": "^4.2.0",
"micromatch": "^4.0.4",
"minimist": "^1.2.5",
"npm-run-all": "^4.1.5",

File diff suppressed because it is too large Load Diff

@ -17,7 +17,7 @@ import { Header } from '../shared'
import anchor from 'markdown-it-anchor'
import attrs from 'markdown-it-attrs'
import emoji from 'markdown-it-emoji'
import toc from 'markdown-it-table-of-contents'
import toc from 'markdown-it-toc-done-right'
export interface MarkdownOptions extends MarkdownIt.Options {
lineNumbers?: boolean
@ -31,7 +31,7 @@ export interface MarkdownOptions extends MarkdownIt.Options {
allowedAttributes?: string[]
}
theme?: Theme
// https://github.com/Oktavilla/markdown-it-table-of-contents
// https://github.com/nagaozen/markdown-it-toc-done-right
toc?: any
externalLinks?: Record<string, string>
}
@ -89,8 +89,9 @@ export const createMarkdownRenderer = async (
})
.use(toc, {
slugify,
includeLevel: [2, 3],
level: [2, 3],
format: parseHeader,
listType: 'ul',
...options.toc
})
.use(emoji)

@ -8,11 +8,6 @@ declare module 'markdown-it-emoji' {
export default def
}
declare module 'markdown-it-table-of-contents' {
const def: any
export default def
}
declare module 'markdown-it-container' {
const def: any
export default def

Loading…
Cancel
Save