Merge pull request #768 from ldapjs/dependabot/npm_and_yarn/marked-4.0.0
This commit is contained in:
commit
11ccea9e9b
|
@ -36,7 +36,7 @@
|
|||
"get-port": "^5.1.1",
|
||||
"highlight.js": "^11.0.1",
|
||||
"husky": "^4.2.5",
|
||||
"marked": "^3.0.0",
|
||||
"marked": "^4.0.0",
|
||||
"tap": "15.0.10"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
const fs = require('fs/promises')
|
||||
const path = require('path')
|
||||
const marked = require('marked')
|
||||
const { marked } = require('marked')
|
||||
const fm = require('front-matter')
|
||||
const { highlight } = require('highlight.js')
|
||||
|
||||
marked.use({
|
||||
highlight: (code, lang) => {
|
||||
if (lang) {
|
||||
return highlight(lang, code).value
|
||||
return highlight(code, { language: lang }).value
|
||||
}
|
||||
|
||||
return code
|
||||
|
@ -100,7 +100,13 @@ async function createDocs () {
|
|||
const branding = path.join(docs, 'branding')
|
||||
const src = path.join(branding, 'public')
|
||||
|
||||
await fs.rmdir(dist, { recursive: true })
|
||||
try {
|
||||
await fs.rm(dist, { recursive: true })
|
||||
} catch (ex) {
|
||||
if (ex.code !== 'ENOENT') {
|
||||
throw ex
|
||||
}
|
||||
}
|
||||
await copyRecursive(src, dist)
|
||||
|
||||
const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')
|
||||
|
|
Loading…
Reference in New Issue