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

This commit is contained in:
Vanessa 2024-11-02 14:23:50 +08:00
commit c164e8741c
5 changed files with 33 additions and 9 deletions

View file

@ -388,7 +388,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
tempElement.querySelectorAll('[contenteditable="false"][spellcheck]').forEach((e) => {
e.setAttribute("contenteditable", "true");
});
const tempInnerHTML = tempElement.innerHTML;
let tempInnerHTML = tempElement.innerHTML;
if (!nodeElement.classList.contains("av") && tempInnerHTML.startsWith("[[{") && tempInnerHTML.endsWith("}]]")) {
try {
const json = JSON.parse(tempInnerHTML);
@ -401,6 +401,10 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
insertHTML(tempInnerHTML, protyle, isBlock);
}
} else {
if (-1 < tempInnerHTML.indexOf("NodeHTMLBlock")) {
// 复制 HTML 块粘贴出来的不是 HTML 块 https://github.com/siyuan-note/siyuan/issues/12994
tempInnerHTML = Lute.UnEscapeHTMLStr(tempInnerHTML);
}
insertHTML(tempInnerHTML, protyle, isBlock, false, true);
}
filterClipboardHint(protyle, protyle.lute.BlockDOM2StdMd(tempInnerHTML));