diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts index 87b884562..0c66950ce 100644 --- a/app/src/boot/globalEvent/keydown.ts +++ b/app/src/boot/globalEvent/keydown.ts @@ -366,7 +366,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => { const actionElementId = actionElement.getAttribute("data-node-id"); if (range.toString() !== "") { getContentByInlineHTML(range, (content) => { - writeText(`((${actionElementId} "${Lute.EscapeHTMLStr(content.trim())}"))`); + writeText(`((${actionElementId} "${content.trim()}"))`); }); } else { fetchPost("/api/block/getRefText", {id: actionElementId}, (response) => { diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 3460f6bce..bb365b6c0 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -997,7 +997,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { if (selectText !== "") { // 和复制块引用保持一致 https://github.com/siyuan-note/siyuan/issues/9093 getContentByInlineHTML(range, (content) => { - writeText(`${Lute.EscapeHTMLStr(content.trim())} ((${nodeElement.getAttribute("data-node-id")} "*"))`); + writeText(`${content.trim()} ((${nodeElement.getAttribute("data-node-id")} "*"))`); }); } else { nodeElement.setAttribute("data-reftext", "true"); @@ -1036,14 +1036,13 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { } else { getContentByInlineHTML(range, (content) => { const oldHTML = topElement.outerHTML; - const name = Lute.EscapeHTMLStr(content.trim()); const nameElement = topElement.lastElementChild.querySelector(".protyle-attr--name"); if (nameElement) { - nameElement.innerHTML = `${name}`; + nameElement.innerHTML = `${content.trim()}`; } else { - topElement.lastElementChild.insertAdjacentHTML("afterbegin", `
${name}
`); + topElement.lastElementChild.insertAdjacentHTML("afterbegin", `
${content.trim()}
`); } - topElement.setAttribute("name", name); + topElement.setAttribute("name", content.trim()); updateTransaction(protyle, topElement.getAttribute("data-node-id"), topElement.outerHTML, oldHTML); }); }