Skip to content

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

:bug: Keep document modification time current after table edits https://github.com/siyuan-note/siyuan/issues/19779

Danielaccdd23b44ef
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 1cb1a84efc..986261aa92 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -1,4 +1,5 @@
import {fetchPost, fetchSyncPost} from "../../util/fetch";
+import * as dayjs from "dayjs";
import {restoreInlineElementBoundaryHTML} from "../util/inlineElementBoundary";
import {getEditorTransaction} from "../util/transactionContract";
import {
@@ -2526,11 +2527,15 @@ export const updateTransaction = (protyle: IProtyle, element: Element, oldHTML:
refreshSbResize(element);
}
const id = element.getAttribute("data-node-id");
- const newHTML = cleanListMindmapHTML(cleanHeadingNumberHTML(cleanTableCellRichHTML(cleanBlockSelectionModeHTML(element.outerHTML))));
+ let newHTML = cleanListMindmapHTML(cleanHeadingNumberHTML(cleanTableCellRichHTML(cleanBlockSelectionModeHTML(element.outerHTML))));
const cleanOldHTML = cleanListMindmapHTML(cleanHeadingNumberHTML(cleanTableCellRichHTML(cleanBlockSelectionModeHTML(oldHTML))));
if (newHTML === cleanOldHTML.replace("<wbr>", "") && !additionalOperations) {
return;
}
+ if (element.getAttribute("data-type") === "NodeTable") {
+ element.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
+ newHTML = cleanListMindmapHTML(cleanHeadingNumberHTML(cleanTableCellRichHTML(cleanBlockSelectionModeHTML(element.outerHTML))));
+ }
element.setAttribute(Constants.ATTRIBUTE_EDITING, "true");
const doOperations: IOperation[] = [{
id,