Skip to content

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

:art: Prefix internal table header attributes https://github.com/siyuan-note/siyuan/issues/18503

Daniel663951663c1e
diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scss
index 8988e2b29d..af2d49be71 100644
--- a/app/src/assets/scss/component/_typography.scss
+++ b/app/src/assets/scss/component/_typography.scss
@@ -376,18 +376,18 @@
}
}
- [data-type="NodeTable"][custom-table-header-row="false"] thead th,
- [data-type="NodeTable"][custom-table-header-row="false"] thead td {
+ [data-type="NodeTable"][custom-sy-table-header-row="false"] thead th,
+ [data-type="NodeTable"][custom-sy-table-header-row="false"] thead td {
font-weight: normal;
}
- [data-type="NodeTable"]:not([custom-table-header-row="false"]) thead th,
- [data-type="NodeTable"]:not([custom-table-header-row="false"]) thead td {
+ [data-type="NodeTable"]:not([custom-sy-table-header-row="false"]) thead th,
+ [data-type="NodeTable"]:not([custom-sy-table-header-row="false"]) thead td {
background-color: var(--b3-table-even-background);
}
- [data-type="NodeTable"][custom-table-header-column="true"] tr > th:first-child,
- [data-type="NodeTable"][custom-table-header-column="true"] tr > td:first-child {
+ [data-type="NodeTable"][custom-sy-table-header-column="true"] tr > th:first-child,
+ [data-type="NodeTable"][custom-sy-table-header-column="true"] tr > td:first-child {
font-weight: 600;
background-color: var(--b3-table-even-background);
}
diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts
index 6731cc207b..d004aa1493 100644
--- a/app/src/protyle/util/table.ts
+++ b/app/src/protyle/util/table.ts
@@ -42,13 +42,13 @@ export const getColIndex = (cellElement: HTMLElement) => {
};
export const isTableHeaderEnabled = (nodeElement: Element, type: "row" | "column") => {
- return type === "row" ? nodeElement.getAttribute("custom-table-header-row") !== "false" :
- nodeElement.getAttribute("custom-table-header-column") === "true";
+ return type === "row" ? nodeElement.getAttribute("custom-sy-table-header-row") !== "false" :
+ nodeElement.getAttribute("custom-sy-table-header-column") === "true";
};
export const toggleTableHeader = (protyle: IProtyle, nodeElement: Element, type: "row" | "column") => {
const html = nodeElement.outerHTML;
- const attribute = `custom-table-header-${type}`;
+ const attribute = `custom-sy-table-header-${type}`;
if (isTableHeaderEnabled(nodeElement, type)) {
if (type === "row") {
nodeElement.setAttribute(attribute, "false");