Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/8972

Vanessa91667b175a83
diff --git a/app/src/protyle/wysiwyg/input.ts b/app/src/protyle/wysiwyg/input.ts
index 533805ea23..766267eedc 100644
--- a/app/src/protyle/wysiwyg/input.ts
+++ b/app/src/protyle/wysiwyg/input.ts
@@ -148,12 +148,17 @@ export const input = async (protyle: IProtyle, blockElement: HTMLElement, range:
// 使用 md 闭合后继续输入应为普通文本
blockElement.outerHTML = html.replace("</span><wbr>", "</span>" + Constants.ZWSP + "<wbr>");
}
+ // https://github.com/siyuan-note/siyuan/issues/8972
+ const mathSize = blockElement.querySelectorAll('[data-type="inline-math"]').length;
protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${id}"]`).forEach((item: HTMLElement) => {
if (item.getAttribute("data-type") === "NodeBlockQueryEmbed" ||
!hasClosestByAttribute(item, "data-type", "NodeBlockQueryEmbed")) {
blockElement = item;
}
});
+ if (mathSize > 0 && mathSize < html.split('<span data-type="inline-math" data-subtype="math"').length - 1) {
+ // protyle.toolbar.showRender(protyle, mathElement);
+ }
Array.from(tempElement.content.children).forEach((item, index) => {
const tempId = item.getAttribute("data-node-id");
let realElement;