Skip to content

Commit a52dfd9

Browse files
committed
Remove DOMPurify from docsify-server-renderer
1 parent 8a532b8 commit a52dfd9

File tree

3 files changed

+279
-119
lines changed

3 files changed

+279
-119
lines changed

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)