feat: add micromark 3 compatible code title parser

This commit is contained in:
Timothy Lin 2021-06-26 18:50:49 +08:00
parent 553722750e
commit f7cda6f536
3 changed files with 2 additions and 33 deletions

View File

@ -4,6 +4,7 @@ import matter from 'gray-matter'
import path from 'path'
import readingTime from 'reading-time'
import visit from 'unist-util-visit'
import codeTitles from './remark-code-title'
import imgToJsx from './img-to-jsx'
import getAllFilesRecursively from './utils/files'
@ -77,7 +78,7 @@ export async function getFileBySlug(type, slug) {
require('remark-slug'),
require('remark-autolink-headings'),
require('remark-gfm'),
require('remark-code-titles'),
codeTitles,
[require('remark-footnotes'), { inlineNotes: true }],
require('remark-math'),
imgToJsx,

31
package-lock.json generated
View File

@ -7455,37 +7455,6 @@
"unist-util-visit": "^2.0.0"
}
},
"remark-code-titles": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/remark-code-titles/-/remark-code-titles-0.1.2.tgz",
"integrity": "sha512-KsHQbaI4FX8Ozxqk7YErxwmBiveUqloKuVqyPG2YPLHojpgomodWgRfG4B+bOtmn/5bfJ8khw4rR0lvgVFl2Uw==",
"requires": {
"unist-util-visit": "^1.4.0"
},
"dependencies": {
"unist-util-is": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz",
"integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A=="
},
"unist-util-visit": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz",
"integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==",
"requires": {
"unist-util-visit-parents": "^2.0.0"
}
},
"unist-util-visit-parents": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz",
"integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==",
"requires": {
"unist-util-is": "^3.0.0"
}
}
}
},
"remark-footnotes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/remark-footnotes/-/remark-footnotes-3.0.0.tgz",

View File

@ -28,7 +28,6 @@
"reading-time": "1.3.0",
"rehype-katex": "^5.0.0",
"remark-autolink-headings": "6.0.1",
"remark-code-titles": "0.1.2",
"remark-footnotes": "^3.0.0",
"remark-gfm": "^1.0.0",
"remark-math": "^4.0.0",