fix: Error when viewing text component in RAW HTML (#1869)

This commit is contained in:
Muhammad Faraz Maqsood
2025-04-29 01:51:54 +05:00
committed by GitHub
parent d92b27ee93
commit 65aca04708

View File

@@ -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,