Skip to content

Commit

Permalink
Restore ability to execute remote content scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jhildenbiddle committed Feb 5, 2021
1 parent e6c6abb commit 0059ba2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/docsify-server-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export default class Renderer {
this._renderHtml('cover', await this._render(coverFile), 'cover');
}

const html = this.isRemoteUrl ? DOMPurify.sanitize(this.html) : this.html;
const html = this.isRemoteUrl
? DOMPurify.sanitize(this.html, { ADD_TAGS: ['script'] })
: this.html;
this.html = this.template;
return html;
}
Expand Down
4 changes: 3 additions & 1 deletion src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ export function renderMixin(proto) {
},
tokens => {
html = this.compiler.compile(tokens);
html = this.isRemoteUrl ? DOMPurify.sanitize(html) : html;
html = this.isRemoteUrl
? DOMPurify.sanitize(html, { ADD_TAGS: ['script'] })
: html;
callback();
next();
}
Expand Down

0 comments on commit 0059ba2

Please sign in to comment.