An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: fix https://github.com/siyuan-note/siyuan/issues/6335
Vanessa5f1f636f39cb
diff --git a/app/src/config/search.ts b/app/src/config/search.tsindex e75aee888f..b312d31064 100644--- a/app/src/config/search.ts+++ b/app/src/config/search.ts@@ -72,7 +72,8 @@ export const initConfigSearch = (element: HTMLElement) => {"dataRepoKeyTip1", "dataRepoKeyTip2", "slogan", "currentVer", "checkUpdate", "updatePath", "systemLog","importKey", "genKey", "genKeyByPW", "copyKey", "resetRepo", "systemLogTip", "export", "visitAnnouncements","safeQuit", "directConnection", "siyuanNote", "key", "password", "copied", "resetRepoTip",- "autoDownloadUpdatePkg", "autoDownloadUpdatePkgTip", "networkProxy", "keyPlaceholder", "initRepoKeyTip"]),+ "autoDownloadUpdatePkg", "autoDownloadUpdatePkgTip", "networkProxy", "keyPlaceholder", "initRepoKeyTip",+ "useFixedPort", "useFixedPortTip"]),];const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;if (window.siyuan.config.system.container !== "ios") {diff --git a/app/src/protyle/wysiwyg/getBlock.ts b/app/src/protyle/wysiwyg/getBlock.tsindex 3a9039db16..4a4b23a178 100644--- a/app/src/protyle/wysiwyg/getBlock.ts+++ b/app/src/protyle/wysiwyg/getBlock.ts@@ -1,4 +1,5 @@import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";+import {Constants} from "../../constants";export const getPreviousHeading = (element: Element) => {let previous = getPreviousBlock(element);@@ -68,7 +69,7 @@ export const getNextBlock = (element: Element) => {export const getNoContainerElement = (element: Element) => {let childElement = element;while (childElement) {- if (childElement.classList.contains("list") || childElement.classList.contains("li")|| childElement.classList.contains("bq")|| childElement.classList.contains("sb")) {+ if (childElement.classList.contains("list") || childElement.classList.contains("li") || childElement.classList.contains("bq") || childElement.classList.contains("sb")) {childElement = childElement.querySelector("[data-node-id]");} else {return childElement;@@ -94,11 +95,18 @@ export const getTopEmptyElement = (element: Element) => {while (topElement.parentElement && !topElement.parentElement.classList.contains("protyle-wysiwyg")) {if (!topElement.parentElement.getAttribute("data-node-id")) {topElement = topElement.parentElement;- } else if (getContenteditableElement(topElement.parentElement).textContent !== "" ||- topElement.previousElementSibling?.getAttribute("data-node-id")) {- break;} else {- topElement = topElement.parentElement;+ const hasText = Array.from(topElement.parentElement.querySelectorAll('[contenteditable="true"]')).find(item => {+ if (item.textContent.replace(Constants.ZWSP, "").replace("\n", "") !== "") {+ return true;+ }+ });+ if (!hasText || topElement.previousElementSibling?.getAttribute("data-node-id") ||+ topElement.nextElementSibling?.getAttribute("data-node-id")) {+ break;+ } else {+ topElement = topElement.parentElement;+ }}}return topElement;