File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11import Sidebar from "components/sidebar" ;
22import tile from "components/tile" ;
33import confirm from "dialogs/confirm" ;
4+ import DOMPurify from "dompurify" ;
45import fsOperation from "fileSystem" ;
56import startDrag from "handlers/editorFileTab" ;
67import tag from "html-tag-js" ;
@@ -244,7 +245,12 @@ export default class EditorFile {
244245 const content = tag ( "div" , {
245246 className : "tab-page-content" ,
246247 } ) ;
247- content . appendChild ( options . content ) ;
248+
249+ if ( typeof options . content === "string" ) {
250+ content . innerHTML = DOMPurify . sanitize ( options . content ) ;
251+ } else {
252+ content . appendChild ( options . content ) ;
253+ }
248254
249255 // Append content container to shadow DOM
250256 shadow . appendChild ( content ) ;
You can’t perform that action at this time.
0 commit comments