@@ -119,32 +119,29 @@ const createMarkdownShortcutsPlugin = (config = {}) => {
119119 }
120120 return 'not-handled' ;
121121 } ,
122- handleReturn ( ev , { setEditorState, getEditorState } ) {
123- const editorState = getEditorState ( ) ;
122+ handleReturn ( ev , editorState , { setEditorState } ) {
124123 const newEditorState = checkReturnForState ( editorState , ev ) ;
125124 if ( editorState !== newEditorState ) {
126125 setEditorState ( newEditorState ) ;
127126 return 'handled' ;
128127 }
129128 return 'not-handled' ;
130129 } ,
131- handleBeforeInput ( character , { getEditorState , setEditorState } ) {
130+ handleBeforeInput ( character , editorState , { setEditorState } ) {
132131 if ( character !== ' ' ) {
133132 return 'not-handled' ;
134133 }
135- const editorState = getEditorState ( ) ;
136134 const newEditorState = checkCharacterForState ( editorState , character ) ;
137135 if ( editorState !== newEditorState ) {
138136 setEditorState ( newEditorState ) ;
139137 return 'handled' ;
140138 }
141139 return 'not-handled' ;
142140 } ,
143- handlePastedText ( text , html , { getEditorState , setEditorState } ) {
141+ handlePastedText ( text , html , editorState , { setEditorState } ) {
144142 if ( html ) {
145143 return 'not-handled' ;
146144 }
147- const editorState = getEditorState ( ) ;
148145 let newEditorState = editorState ;
149146 let buffer = [ ] ;
150147 for ( let i = 0 ; i < text . length ; i ++ ) { // eslint-disable-line no-plusplus
0 commit comments