fix: backport changes for html button in text component markdown editor (#2065)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -41,6 +41,7 @@ exports[`SourceCodeModal renders as expected with default behavior 1`] = `
|
||||
>
|
||||
<injectIntl(ShimmedIntlComponent)
|
||||
innerRef="moCKrEf"
|
||||
lang="html"
|
||||
value="mOckHtMl"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import {
|
||||
@@ -41,6 +40,7 @@ const SourceCodeModal = ({
|
||||
<CodeEditor
|
||||
innerRef={ref}
|
||||
value={value}
|
||||
lang="html" // hardcoded value to do lookup on CODEMIRROR_LANGUAGES
|
||||
/>
|
||||
</div>
|
||||
</BaseModal>
|
||||
|
||||
Reference in New Issue
Block a user