Skip to content

Commit 65aca04

Browse files
authored
fix: Error when viewing text component in RAW HTML (#1869)
1 parent d92b27e commit 65aca04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • src/editors/sharedComponents/CodeEditor

src/editors/sharedComponents/CodeEditor/hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const createCodeMirrorDomNode = ({
100100
}) => {
101101
// eslint-disable-next-line react-hooks/rules-of-hooks
102102
useEffect(() => {
103-
const languageExtension = CODEMIRROR_LANGUAGES[lang]();
103+
const languageExtension = CODEMIRROR_LANGUAGES[lang] ? CODEMIRROR_LANGUAGES[lang]() : xml();
104104
const cleanText = cleanHTML({ initialText });
105105
const newState = EditorState.create({
106106
doc: cleanText,

0 commit comments

Comments
 (0)