Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

fix(protyle): https://github.com/siyuan-note/siyuan/issues/13590 (#13596)

Jeffrey Chene3d3e5317256
diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts
index f39658ab40..7c6187e851 100644
--- a/app/src/protyle/wysiwyg/input.ts
+++ b/app/src/protyle/wysiwyg/input.ts
@@ -113,11 +113,10 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
return;
}
// https://github.com/siyuan-note/siyuan/issues/9015
- if (trimStartText === "¥¥<wbr>" || trimStartText === "¥¥<wbr>") {
- editElement.innerHTML = "$$<wbr>";
- } else if (trimStartText.indexOf("\n¥¥<wbr>") > -1 || trimStartText.indexOf("\n¥¥<wbr>") > -1) {
- // https://ld246.com/article/1730020516427
- editElement.innerHTML = trimStartText.replace("\n¥¥<wbr>", "\n$$$$<wbr>").replace("\n¥¥<wbr>", "\n$$$$<wbr>");
+ if (type !== "NodeHeading" &&
+ (editElement.innerHTML.startsWith("¥¥<wbr>") || editElement.innerHTML.startsWith("¥¥<wbr>") ||
+ trimStartText.indexOf("\n¥¥<wbr>") > -1 || trimStartText.indexOf("\n¥¥<wbr>") > -1)) {
+ editElement.innerHTML = editElement.innerHTML.replace("¥¥<wbr>", "$$$$<wbr>").replace("¥¥<wbr>", "$$$$<wbr>");
}
const refElement = hasClosestByAttribute(range.startContainer, "data-type", "block-ref");
if (refElement && refElement.getAttribute("data-subtype") === "d") {