From b902789aa4eddc8cf5e577b26e341b158a0707dd Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 19 Sep 2023 10:05:10 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9183 --- app/src/assets/scss/pdf/_pdf.scss | 1 + app/src/protyle/util/paste.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/assets/scss/pdf/_pdf.scss b/app/src/assets/scss/pdf/_pdf.scss index 788e2f2d8..c52662b46 100644 --- a/app/src/assets/scss/pdf/_pdf.scss +++ b/app/src/assets/scss/pdf/_pdf.scss @@ -39,6 +39,7 @@ &__util { z-index: 4; + padding: 8px; &--hide .pdf__util__hide { display: none; diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 2a44ebe45..1cb98a8b3 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -301,6 +301,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven uploadFiles(protyle, files); } else if (textPlain.trim() !== "" && files && files.length === 0) { if (range.toString() !== "") { + const firstLine = textPlain.split("\n")[0]; if (isDynamicRef(textPlain)) { protyle.toolbar.setInlineMark(protyle, "block-ref", "range", { type: "id", @@ -308,10 +309,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven color: `${textPlain.substring(2, 22 + 2)}${Constants.ZWSP}s${Constants.ZWSP}${range.toString()}` }); return; - } else if (isFileAnnotation(textPlain)) { + } else if (isFileAnnotation(firstLine)) { protyle.toolbar.setInlineMark(protyle, "file-annotation-ref", "range", { type: "file-annotation-ref", - color: textPlain.substring(2).replace(/ ".+">>$/, "") + color: firstLine.substring(2).replace(/ ".+">>$/, "") }); return; } else if (protyle.lute.IsValidLinkDest(textPlain)) {