Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17069

Vanessa27c6b51e9d02
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index fb22972969..c0714d0dfa 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -2176,7 +2176,7 @@ export class Gutter {
}
private genAlign(nodeElements: Element[], protyle: IProtyle) {
- const disabledRTL = nodeElements.some(e => e.classList.contains("code-block") || ["NodeMathBlock"].includes(e.getAttribute("data-type")));
+ const disabledRTL = nodeElements.some(e => ["NodeAttributeView", "NodeCodeBlock", "NodeMathBlock"].includes(e.getAttribute("data-type")));
window.siyuan.menus.menu.append(new MenuItem({
id: "layout",
label: window.siyuan.languages.layout,
@@ -2249,7 +2249,13 @@ export class Gutter {
accelerator: window.siyuan.config.keymap.editor.general.ltr.custom,
click: () => {
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
- e.style.direction = "ltr";
+ if (e.classList.contains("table")) {
+ e.querySelector("table").style.direction = "ltr";
+ } else if (e.getAttribute("data-type") === "NodeHTMLBlock") {
+ (e.querySelector("protyle-html") as HTMLElement).style.direction = "ltr";
+ } else {
+ e.style.direction = "ltr";
+ }
});
}
}, {
@@ -2260,7 +2266,11 @@ export class Gutter {
accelerator: window.siyuan.config.keymap.editor.general.rtl.custom,
click: () => {
this.genClick(nodeElements, protyle, (e: HTMLElement) => {
- if (!e.classList.contains("av")) {
+ if (e.classList.contains("table")) {
+ e.querySelector("table").style.direction = "rtl";
+ } else if (e.getAttribute("data-type") === "NodeHTMLBlock") {
+ (e.querySelector("protyle-html") as HTMLElement).style.direction = "rtl";
+ } else {
e.style.direction = "rtl";
}
});
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index 0eca758779..deb6d5acae 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -292,9 +292,8 @@ export const setInlineStyle = async (set = true, servePath = "../../../") => {
if (window.siyuan.config.editor.rtl) {
style += `\n.protyle-title__input,
.protyle-wysiwyg .p,
-.protyle-wysiwyg .table,
+.protyle-wysiwyg .table table,
.protyle-wysiwyg .render-node protyle-html,
-.protyle-wysiwyg .render-node:not([data-type="NodeMathBlock"]) > div[spin="1"],
.protyle-wysiwyg [data-type="NodeHeading"] {direction: rtl}
.protyle-wysiwyg [data-node-id].li > .protyle-action {
right: 0;