File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,18 @@ import { replaceText } from './utils';
2121
2222function checkCharacterForState ( editorState , character ) {
2323 let newEditorState = handleBlockType ( editorState , character ) ;
24+ const contentState = editorState . getCurrentContent ( ) ;
25+ const selection = editorState . getSelection ( ) ;
26+ const key = selection . getStartKey ( ) ;
27+ const currentBlock = contentState . getBlockForKey ( key ) ;
28+ const type = currentBlock . getType ( ) ;
2429 if ( editorState === newEditorState ) {
2530 newEditorState = handleImage ( editorState , character ) ;
2631 }
2732 if ( editorState === newEditorState ) {
2833 newEditorState = handleLink ( editorState , character ) ;
2934 }
30- if ( editorState === newEditorState ) {
35+ if ( editorState === newEditorState && type !== 'code-block' ) {
3136 newEditorState = handleInlineStyle ( editorState , character ) ;
3237 }
3338 return newEditorState ;
You can’t perform that action at this time.
0 commit comments