@@ -65,7 +65,7 @@ export function initCompImagePaste($target) {
6565 for ( const textarea of this . querySelectorAll ( 'textarea' ) ) {
6666 textarea . addEventListener ( 'paste' , async ( e ) => {
6767 for ( const img of clipboardPastedImages ( e ) ) {
68- const name = img . name . substr ( 0 , img . name . lastIndexOf ( '.' ) ) ;
68+ const name = img . name . slice ( 0 , img . name . lastIndexOf ( '.' ) ) ;
6969 insertAtCursor ( textarea , `![${ name } ]()` ) ;
7070 const data = await uploadFile ( img , uploadUrl ) ;
7171 replaceAndKeepCursor ( textarea , `![${ name } ]()` , `` ) ;
@@ -81,7 +81,7 @@ export function initEasyMDEImagePaste(easyMDE, dropzone, files) {
8181 const uploadUrl = dropzone . getAttribute ( 'data-upload-url' ) ;
8282 easyMDE . codemirror . on ( 'paste' , async ( _ , e ) => {
8383 for ( const img of clipboardPastedImages ( e ) ) {
84- const name = img . name . substr ( 0 , img . name . lastIndexOf ( '.' ) ) ;
84+ const name = img . name . slice ( 0 , img . name . lastIndexOf ( '.' ) ) ;
8585 const data = await uploadFile ( img , uploadUrl ) ;
8686 const pos = easyMDE . codemirror . getCursor ( ) ;
8787 easyMDE . codemirror . replaceRange ( `` , pos ) ;
0 commit comments