Skip to content

Commit 173fee4

Browse files
committed
Extend script component to prevent script execution from custom code
1 parent 4011d40 commit 173fee4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ export default (editor, opts = {}) => {
1111
const { toolbarBtnCustomCode } = opts;
1212
let timedInterval;
1313

14+
dc.addType('script', {
15+
view: {
16+
onRender() {
17+
const isCC = this.model.closestType(typeCustomCode);
18+
isCC && (this.el.innerHTML = '');
19+
}
20+
},
21+
});
22+
1423
dc.addType(typeCustomCode, {
1524

1625
model: defaultModel.extend({

0 commit comments

Comments
 (0)