Skip to content

Commit bb1fe92

Browse files
committed
feat: use dompurify
1 parent 65377b2 commit bb1fe92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/editorFile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Sidebar from "components/sidebar";
22
import tile from "components/tile";
33
import confirm from "dialogs/confirm";
4+
import DOMPurify from "dompurify";
45
import fsOperation from "fileSystem";
56
import startDrag from "handlers/editorFileTab";
67
import tag from "html-tag-js";
@@ -246,7 +247,7 @@ export default class EditorFile {
246247
});
247248

248249
if (typeof options.content === "string") {
249-
content.innerHTML = options.content;
250+
content.innerHTML = DOMPurify.sanitize(options.content);
250251
} else {
251252
content.appendChild(options.content);
252253
}

0 commit comments

Comments
 (0)