@@ -749,7 +749,13 @@ export default class CodeEditor extends React.Component {
749
749
this . handlePasteText ( editor , pastedTxt )
750
750
} else if ( fetchUrlTitle && isURL ( pastedTxt ) && ! isInLinkTag ( editor ) ) {
751
751
this . handlePasteUrl ( editor , pastedTxt )
752
- } else if ( enableSmartPaste || forceSmartPaste ) {
752
+ } else if ( attachmentManagement . isAttachmentLink ( pastedTxt ) ) {
753
+ attachmentManagement
754
+ . handleAttachmentLinkPaste ( storageKey , noteKey , pastedTxt )
755
+ . then ( modifiedText => {
756
+ this . editor . replaceSelection ( modifiedText )
757
+ } )
758
+ } else {
753
759
const image = clipboard . readImage ( )
754
760
if ( ! image . isEmpty ( ) ) {
755
761
attachmentManagement . handlePastNativeImage (
@@ -758,22 +764,16 @@ export default class CodeEditor extends React.Component {
758
764
noteKey ,
759
765
image
760
766
)
761
- } else {
767
+ } else if ( enableSmartPaste || forceSmartPaste ) {
762
768
const pastedHtml = clipboard . readHTML ( )
763
769
if ( pastedHtml . length > 0 ) {
764
770
this . handlePasteHtml ( editor , pastedHtml )
765
771
} else {
766
772
this . handlePasteText ( editor , pastedTxt )
767
773
}
774
+ } else {
775
+ this . handlePasteText ( editor , pastedTxt )
768
776
}
769
- } else if ( attachmentManagement . isAttachmentLink ( pastedTxt ) ) {
770
- attachmentManagement
771
- . handleAttachmentLinkPaste ( storageKey , noteKey , pastedTxt )
772
- . then ( modifiedText => {
773
- this . editor . replaceSelection ( modifiedText )
774
- } )
775
- } else {
776
- this . handlePasteText ( editor , pastedTxt )
777
777
}
778
778
}
779
779
0 commit comments