From 8aa4dac91f6c719d8ffd9824ca90ec6cba76810e Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 14 Mar 2023 22:53:19 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7666 --- app/src/protyle/wysiwyg/transaction.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index de1957977..c7bca1271 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -426,22 +426,26 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b return; } if (operation.action === "updateAttrs") { // 调用接口才推送 - let nodeAttrHTML = ""; const data = operation.data as any; const attrsResult: IObject = {}; + let bookmarkHTML = '' + let nameHTML = '' + let aliasHTML = '' + let memoHTML = '' Object.keys(data.new).forEach(key => { attrsResult[key] = data.new[key]; const escapeHTML = Lute.EscapeHTMLStr(data.new[key]); if (key === "bookmark") { - nodeAttrHTML += `
${escapeHTML}
`; + bookmarkHTML = `
${escapeHTML}
`; } else if (key === "name") { - nodeAttrHTML += `
${escapeHTML}
`; + nameHTML = `
${escapeHTML}
`; } else if (key === "alias") { - nodeAttrHTML += `
${escapeHTML}
`; + aliasHTML = `
${escapeHTML}
`; } else if (key === "memo") { - nodeAttrHTML += `
`; + memoHTML = `
`; } }); + let nodeAttrHTML = bookmarkHTML + nameHTML + aliasHTML + memoHTML; if (protyle.block.rootID === operation.id && protyle.title) { // 文档 const refElement = protyle.title.element.querySelector(".protyle-attr--refcount");