File tree Expand file tree Collapse file tree
src/commands/default-commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,18 +42,19 @@ export const saveImageCommand: Command = {
4242 const items = isPasteEvent ( context )
4343 ? dataTransferToArray ( ( event as React . ClipboardEvent ) . clipboardData . items )
4444 : isDragEvent ( context )
45- ? dataTransferToArray ( ( event as React . DragEvent ) . dataTransfer . items )
46- : fileListToArray (
45+ ? dataTransferToArray ( ( event as React . DragEvent ) . dataTransfer . items )
46+ : fileListToArray (
4747 ( event as React . ChangeEvent < HTMLInputElement > ) . target . files
4848 ) ;
4949
5050 for ( const index in items ) {
51+ const initialState = textApi . getState ( ) ;
5152 const breaksBeforeCount = getBreaksNeededForEmptyLineBefore (
5253 initialState . text ,
5354 initialState . selection . start
5455 ) ;
55- const breaksBefore = Array ( breaksBeforeCount + 1 ) . join ( "\n" ) ;
5656
57+ const breaksBefore = Array ( breaksBeforeCount + 1 ) . join ( "\n" ) ;
5758 const placeHolder = `${ breaksBefore } ![${ l18n . uploadingImage } ]()` ;
5859
5960 textApi . replaceSelection ( placeHolder ) ;
You can’t perform that action at this time.
0 commit comments