An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/6864
Vanessaf53c2fdebd01
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.tsindex 5c4084e480..5d3b963c52 100644--- a/app/src/protyle/hint/extend.ts+++ b/app/src/protyle/hint/extend.ts@@ -89,7 +89,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconCode"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.code}</span><span class="b3-menu__accelerator">\`\`\`Enter</span></div>`,}, {filter: ["表格", "biaoge", "bg", "table"],- value: `| col1${Lute.Caret} | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |`,+ value: `| ${Lute.Caret} | | |\n| --- | --- | --- |\n| | | |\n| | | |`,html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconTable"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.table}</span><span class="b3-menu__accelerator">${updateHotkeyTip((window.siyuan.config.keymap.editor.insert.table.custom))}</span></div>`,}, {filter: ["分割线", "fengexian", "fgx", "divider"],diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex 5a4531674b..7b395a2cd3 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -590,6 +590,13 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;}nodeElement.outerHTML = newHTML;nodeElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${id}"]`);+ // https://github.com/siyuan-note/siyuan/issues/6864+ if (nodeElement.getAttribute("data-type") === "NodeTable") {+ nodeElement.querySelectorAll("colgroup col").forEach((item: HTMLElement) => {+ item.style.width = "80px";+ });+ newHTML = nodeElement.outerHTML;+ }updateTransaction(protyle, id, newHTML, html);} else {let newHTML = protyle.lute.SpinBlockDOM(textContent);@@ -597,13 +604,21 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;newHTML = `<div data-node-id="${Lute.NewNodeID()}" data-type="NodeHTMLBlock" class="render-node" data-subtype="block"><div class="protyle-icons"><span class="protyle-icon protyle-icon--first protyle-action__edit"><svg><use xlink:href="#iconEdit"></use></svg></span><span class="protyle-icon protyle-action__menu protyle-icon--last"><svg><use xlink:href="#iconMore"></use></svg></span></div><div><protyle-html data-content=""></protyle-html><span style="position: absolute">${Constants.ZWSP}</span></div><div class="protyle-attr" contenteditable="false"></div></div>`;}nodeElement.insertAdjacentHTML("afterend", newHTML);+ const oldHTML = nodeElement.outerHTML;const newId = newHTML.substr(newHTML.indexOf('data-node-id="') + 14, 22);+ nodeElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${newId}"]`);+ // https://github.com/siyuan-note/siyuan/issues/6864+ if (nodeElement.getAttribute("data-type") === "NodeTable") {+ nodeElement.querySelectorAll("colgroup col").forEach((item: HTMLElement) => {+ item.style.width = "80px";+ });+ }transaction(protyle, [{- data: nodeElement.outerHTML,+ data: oldHTML,id,action: "update"}, {- data: newHTML,+ data: nodeElement.outerHTML,id: newId,previousID: id,action: "insert"@@ -615,7 +630,6 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;id,action: "update"}]);- nodeElement = protyle.wysiwyg.element.querySelector(`[data-node-id="${newId}"]`);}if (value === "<div>" || value === "$$" || (value.indexOf("```") > -1 && value.length > 3)) {protyle.toolbar.showRender(protyle, nodeElement);diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex 6c4ddf437c..ad3b430013 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -1330,7 +1330,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {if (matchHotKey(window.siyuan.config.keymap.editor.insert.table.custom, event)) {protyle.hint.splitChar = "/";protyle.hint.lastIndex = -1;- protyle.hint.fill(`| col1${Lute.Caret} | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |`, protyle);+ protyle.hint.fill(`| ${Lute.Caret} | | |\n| --- | --- | --- |\n| | | |\n| | | |`, protyle);event.preventDefault();event.stopPropagation();return;