Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/markd.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ const md = require('markdown-it')
const confluencer = require('confluencer')
const { newError, contentSecurityPolicy } = require('./utils.js')

const createDOMPurify = require('dompurify')
const { JSDOM } = require('jsdom')
const window = (new JSDOM('')).window
const DOMPurify = createDOMPurify(window)

const tmpl = fs.readFileSync(path.resolve(__dirname, 'pages', 'template.html'))

const markedppP = promisify(markedpp)
Expand Down Expand Up @@ -44,7 +39,6 @@ async function markdown(title, data, config) {
config.markdownItPlugins(mdIt)

let _data = mdIt.render(data)
_data = DOMPurify.sanitize(_data, { USE_PROFILES: { html: true } })

if (config.confluencer) {
const confluenceHtml =
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('md-fileserver', function () {
return request(url)
.get(filename2uri(resolve(__dirname, 'cheatsheet.md')))
.catch((err) => {
assert.strictEqual(err.message.startsWith('ECONNRESET'), true)
assert.strictEqual(err.code === 'ECONNRESET', true)
})
})
})
Expand Down
1 change: 1 addition & 0 deletions test/test.md/confluencer.key.md.chtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta name="color-scheme" content="light">
<title>confluencer.key.md</title>
<link rel="stylesheet" media="all" href="/static/index.css">
<link rel="stylesheet" media="all" href="/static/highlight/github.css">
Expand Down
1 change: 1 addition & 0 deletions test/test.md/confluencer.md.chtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta name="color-scheme" content="light">
<title>confluencer.md</title>
<link rel="stylesheet" media="all" href="/static/index.css">
<link rel="stylesheet" media="all" href="/static/highlight/github.css">
Expand Down
1 change: 1 addition & 0 deletions test/test.md/confluencer.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta name="color-scheme" content="light">
<title>confluencer.md</title>
<link rel="stylesheet" media="all" href="/static/index.css">
<link rel="stylesheet" media="all" href="/static/highlight/github.css">
Expand Down
Loading