File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -383,8 +383,10 @@ export class WYSIWYG {
383
383
this . emojiToMd ( tempElement ) ;
384
384
}
385
385
html = tempElement . innerHTML ;
386
+ textPlain = range . toString ( ) ;
386
387
} else if ( selectImgElement ) {
387
388
html = selectImgElement . outerHTML ;
389
+ textPlain = selectImgElement . querySelector ( "img" ) . getAttribute ( "data-src" ) ;
388
390
} else if ( selectTypes . length > 0 && range . startContainer . nodeType === 3 && range . startContainer . parentElement . tagName === "SPAN" &&
389
391
range . startContainer . parentElement . isSameNode ( range . endContainer . parentElement ) ) {
390
392
// 复制粗体等字体中的一部分
@@ -400,6 +402,7 @@ export class WYSIWYG {
400
402
}
401
403
spanElement . textContent = range . toString ( ) ;
402
404
html = spanElement . outerHTML ;
405
+ textPlain = range . toString ( ) ;
403
406
} else {
404
407
tempElement . append ( range . cloneContents ( ) ) ;
405
408
this . emojiToMd ( tempElement ) ;
@@ -415,6 +418,8 @@ export class WYSIWYG {
415
418
textPlain = tempElement . textContent . replace ( Constants . ZWSP , "" ) . replace ( / \n $ / , "" ) ;
416
419
} else if ( hasClosestByMatchTag ( range . startContainer , "CODE" ) ) {
417
420
textPlain = tempElement . textContent . replace ( Constants . ZWSP , "" ) ;
421
+ } else {
422
+ textPlain = range . toString ( ) ;
418
423
}
419
424
}
420
425
}
You can’t perform that action at this time.
0 commit comments