Skip to content

Commit

Permalink
chore: Remove dompurify (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhildenbiddle authored and Koooooo-7 committed Oct 26, 2022
1 parent 2bd1171 commit e2c0853
Show file tree
Hide file tree
Showing 6 changed files with 279 additions and 135 deletions.
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"*.js": "eslint --fix"
},
"dependencies": {
"dompurify": "^2.3.1",
"marked": "^1.2.9",
"medium-zoom": "^1.0.6",
"opencollective-postinstall": "^2.0.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/docsify-server-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { resolve, basename } from 'path';
import resolvePathname from 'resolve-pathname';
import fetch from 'node-fetch';
import debug from 'debug';
import DOMPurify from 'dompurify';
import { AbstractHistory } from '../../src/core/router/history/abstract';
import { Compiler } from '../../src/core/render/compiler';
import { isAbsolutePath } from '../../src/core/router/util';
Expand Down Expand Up @@ -123,10 +122,10 @@ export default class Renderer {
this._renderHtml('cover', await this._render(coverFile), 'cover');
}

const html = this.isRemoteUrl
? DOMPurify.sanitize(this.html, { ADD_TAGS: ['script'] })
: this.html;
const html = this.html;

this.html = this.template;

return html;
}

Expand Down
Loading

0 comments on commit e2c0853

Please sign in to comment.