@@ -8,13 +8,18 @@ import handleInlineStyle from './modifiers/handleInlineStyle';
88import handleNewCodeBlock from './modifiers/handleNewCodeBlock' ;
99import insertEmptyBlock from './modifiers/insertEmptyBlock' ;
1010import handleLink from './modifiers/handleLink' ;
11+ import handleImage from './modifiers/handleImage' ;
1112import createLinkDecorator from './decorators/link' ;
13+ import createImageDecorator from './decorators/image' ;
1214
1315const createMarkdownShortcutsPlugin = ( config = { } ) => {
1416 const store = { } ;
1517 return {
1618 blockRenderMap,
17- decorators : [ createLinkDecorator ( config , store ) ] ,
19+ decorators : [
20+ createLinkDecorator ( config , store ) ,
21+ createImageDecorator ( config , store )
22+ ] ,
1823 initialize ( { setEditorState, getEditorState } ) {
1924 store . setEditorState = setEditorState ;
2025 store . getEditorState = getEditorState ;
@@ -67,11 +72,14 @@ const createMarkdownShortcutsPlugin = (config = {}) => {
6772 const editorState = getEditorState ( ) ;
6873 let newEditorState = handleBlockType ( editorState , character ) ;
6974 if ( editorState === newEditorState ) {
70- newEditorState = handleInlineStyle ( editorState , character ) ;
75+ newEditorState = handleImage ( editorState , character ) ;
7176 }
7277 if ( editorState === newEditorState ) {
7378 newEditorState = handleLink ( editorState , character ) ;
7479 }
80+ if ( editorState === newEditorState ) {
81+ newEditorState = handleInlineStyle ( editorState , character ) ;
82+ }
7583 if ( editorState !== newEditorState ) {
7684 setEditorState ( newEditorState ) ;
7785 return 'handled' ;
0 commit comments