Skip to content

Commit 6afe609

Browse files
fix: self-closing script tag fixed for TinyMceEditor (#2510)
(not really valid HTML but preserves backwards compatibility)
1 parent 1b357cb commit 6afe609

File tree

1 file changed

+3
-0
lines changed
  • src/editors/sharedComponents/TinyMceWidget

1 file changed

+3
-0
lines changed

src/editors/sharedComponents/TinyMceWidget/hooks.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ export const editorConfig = ({
457457
valid_elements: '*[*]',
458458
// FIXME: this is passing 'utf-8', which is not a valid entity_encoding value. It should be 'named' etc.
459459
entity_encoding: 'utf-8' as any,
460+
// Protect self-closing <script /> tags from being mangled,
461+
// to preserve backwards compatibility with content that relied on this behavior
462+
protect: [/<script[^>]*\/>/g],
460463
},
461464
};
462465
};

0 commit comments

Comments
 (0)