From 65aca04708b133879881bb1f176d1509d029d918 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Tue, 29 Apr 2025 01:51:54 +0500 Subject: [PATCH] fix: Error when viewing text component in RAW HTML (#1869) --- src/editors/sharedComponents/CodeEditor/hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editors/sharedComponents/CodeEditor/hooks.js b/src/editors/sharedComponents/CodeEditor/hooks.js index 0eb25a7cc..a15e64bf1 100644 --- a/src/editors/sharedComponents/CodeEditor/hooks.js +++ b/src/editors/sharedComponents/CodeEditor/hooks.js @@ -100,7 +100,7 @@ export const createCodeMirrorDomNode = ({ }) => { // eslint-disable-next-line react-hooks/rules-of-hooks useEffect(() => { - const languageExtension = CODEMIRROR_LANGUAGES[lang](); + const languageExtension = CODEMIRROR_LANGUAGES[lang] ? CODEMIRROR_LANGUAGES[lang]() : xml(); const cleanText = cleanHTML({ initialText }); const newState = EditorState.create({ doc: cleanText,