Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #768 from ldapjs/dependabot/npm_and_yarn/marked-4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Nov 13, 2021
2 parents b64ed9f + 66f30b5 commit 11ccea9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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": {
Expand Down
12 changes: 9 additions & 3 deletions scripts/build-docs.js
@@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 11ccea9

Please sign in to comment.