Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/9179

Vanessab037270e9660
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index ddff98fdd1..f5d7020b8e 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -112,7 +112,7 @@ export class WYSIWYG {
if (!isFullWidth) {
isFullWidth = window.siyuan.config.editor.fullWidth ? "true" : "false";
}
- if (isFullWidth ==="true") {
+ if (isFullWidth === "true") {
this.element.parentElement.setAttribute("data-fullwidth", "true");
} else {
this.element.parentElement.removeAttribute("data-fullwidth");
@@ -1500,7 +1500,7 @@ export class WYSIWYG {
window.siyuan.menus.menu.remove();
return;
}
- const range = getEditorRange(this.element);
+ let range = getEditorRange(this.element);
const blockElement = hasClosestBlock(range.startContainer);
if (!blockElement) {
return;
@@ -1521,6 +1521,10 @@ export class WYSIWYG {
this.escapeInline(protyle, range, event);
if (/^\d{1}$/.test(event.data) || event.data === "‘" || event.data === "“") {
setTimeout(() => {
+ // https://github.com/siyuan-note/siyuan/issues/9179
+ if (range.startOffset === 0) {
+ range = getEditorRange(this.element);
+ }
input(protyle, blockElement, range, true); // 搜狗拼音数字后面句号变为点;Mac 反向双引号无法输入
});
} else {