Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-07-26 22:50:44 +08:00
commit a9f5cac024
8 changed files with 389 additions and 196 deletions

View file

@ -277,8 +277,9 @@ export class Preview {
this.processZHTable(copyElement);
} else if (type === "yuque") {
fetchPost("/api/lute/copyStdMarkdown", {
id: protyle.block.rootID,
id: protyle.block.id || protyle.options.blockId || protyle.block.parentID,
assetsDestSpace2Underscore: true,
adjustHeadingLevel: true,
}, (response) => {
writeText(response.data);
showMessage(`${window.siyuan.languages.pasteToYuque}`);

View file

@ -4,10 +4,12 @@ import {transaction, updateTransaction} from "../wysiwyg/transaction";
import {getContenteditableElement} from "../wysiwyg/getBlock";
import {
fixTableRange,
focusBlock, focusByRange,
focusBlock,
focusByRange,
focusByWbr,
getEditorRange,
getSelectionOffset, setLastNodeRange,
getSelectionOffset,
setLastNodeRange,
} from "./selection";
import {Constants} from "../../constants";
import {highlightRender} from "../render/highlightRender";
@ -364,7 +366,6 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
}
let innerHTML = unSpinHTML || // 在 table 中插入需要使用转换好的行内元素 https://github.com/siyuan-note/siyuan/issues/9358
protyle.lute.SpinBlockDOM(html) || // 需要再 spin 一次 https://github.com/siyuan-note/siyuan/issues/7118
html; // 空格会被 Spin 不再,需要使用原文
// 粘贴纯文本时会进行内部转义,这里需要进行反转义 https://github.com/siyuan-note/siyuan/issues/10620
innerHTML = innerHTML.replace(/;;;lt;;;/g, "<").replace(/;;;gt;;;/g, ">");