File tree Expand file tree Collapse file tree 3 files changed +3
-2
lines changed
src/editors/sharedComponents Expand file tree Collapse file tree 3 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export const createCodeMirrorDomNode = ({
100
100
} ) => {
101
101
// eslint-disable-next-line react-hooks/rules-of-hooks
102
102
useEffect ( ( ) => {
103
- const languageExtension = CODEMIRROR_LANGUAGES [ lang ] ( ) ;
103
+ const languageExtension = CODEMIRROR_LANGUAGES [ lang ] ? CODEMIRROR_LANGUAGES [ lang ] ( ) : xml ( ) ;
104
104
const cleanText = cleanHTML ( { initialText } ) ;
105
105
const newState = EditorState . create ( {
106
106
doc : cleanText ,
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ exports[`SourceCodeModal renders as expected with default behavior 1`] = `
41
41
>
42
42
<injectIntl(ShimmedIntlComponent)
43
43
innerRef="moCKrEf"
44
+ lang="html"
44
45
value="mOckHtMl"
45
46
/>
46
47
</div >
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
1
import PropTypes from 'prop-types' ;
3
2
4
3
import {
@@ -41,6 +40,7 @@ const SourceCodeModal = ({
41
40
< CodeEditor
42
41
innerRef = { ref }
43
42
value = { value }
43
+ lang = "html" // hardcoded value to do lookup on CODEMIRROR_LANGUAGES
44
44
/>
45
45
</ div >
46
46
</ BaseModal >
You can’t perform that action at this time.
0 commit comments