File tree 2 files changed +6
-2
lines changed
packages/docsify-server-renderer
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ export default class Renderer {
123
123
this . _renderHtml ( 'cover' , await this . _render ( coverFile ) , 'cover' ) ;
124
124
}
125
125
126
- const html = this . isRemoteUrl ? DOMPurify . sanitize ( this . html ) : this . html ;
126
+ const html = this . isRemoteUrl
127
+ ? DOMPurify . sanitize ( this . html , { ADD_TAGS : [ 'script' ] } )
128
+ : this . html ;
127
129
this . html = this . template ;
128
130
return html ;
129
131
}
Original file line number Diff line number Diff line change @@ -330,7 +330,9 @@ export function renderMixin(proto) {
330
330
} ,
331
331
tokens => {
332
332
html = this . compiler . compile ( tokens ) ;
333
- html = this . isRemoteUrl ? DOMPurify . sanitize ( html ) : html ;
333
+ html = this . isRemoteUrl
334
+ ? DOMPurify . sanitize ( html , { ADD_TAGS : [ 'script' ] } )
335
+ : html ;
334
336
callback ( ) ;
335
337
next ( ) ;
336
338
}
You can’t perform that action at this time.
0 commit comments