Skip to content

Commit 9bff31d

Browse files
chore: Remove dompurify (#1490)
1 parent ba5ee26 commit 9bff31d

File tree

6 files changed

+279
-135
lines changed

6 files changed

+279
-135
lines changed

package-lock.json

-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"*.js": "eslint --fix"
6666
},
6767
"dependencies": {
68-
"dompurify": "^2.3.1",
6968
"marked": "^1.2.9",
7069
"medium-zoom": "^1.0.6",
7170
"opencollective-postinstall": "^2.0.2",

packages/docsify-server-renderer/index.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { resolve, basename } from 'path';
33
import resolvePathname from 'resolve-pathname';
44
import fetch from 'node-fetch';
55
import debug from 'debug';
6-
import DOMPurify from 'dompurify';
76
import { AbstractHistory } from '../../src/core/router/history/abstract';
87
import { Compiler } from '../../src/core/render/compiler';
98
import { isAbsolutePath } from '../../src/core/router/util';
@@ -123,10 +122,10 @@ export default class Renderer {
123122
this._renderHtml('cover', await this._render(coverFile), 'cover');
124123
}
125124

126-
const html = this.isRemoteUrl
127-
? DOMPurify.sanitize(this.html, { ADD_TAGS: ['script'] })
128-
: this.html;
125+
const html = this.html;
126+
129127
this.html = this.template;
128+
130129
return html;
131130
}
132131

0 commit comments

Comments
 (0)