Skip to content

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

:bug: toolbar

Vanessae323f07cccb8
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts
index f065b95ba5..63495ed419 100644
--- a/app/src/protyle/export/index.ts
+++ b/app/src/protyle/export/index.ts
@@ -86,7 +86,7 @@ const renderPDF = (id: string) => {
webSecurity: false,
},
});
- window.siyuan.printWin.webContents.userAgent = 'SiYuan/' + app.getVersion() + ' https://b3log.org/siyuan Electron'
+ window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`
let pdfWidth = "";
if (localData.pageSize === "A3") {
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 13c966e3f3..ed11ccd36f 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -127,10 +127,14 @@ export class Toolbar {
});
const types = this.getCurrentType();
types.forEach(item => {
- if (["search-mark", "a", "block-ref", "virtual-block-ref", "text", "file-annotation-ref", "inline-math", "inline-memo", ""].includes(item)) {
+ if (["search-mark", "a", "block-ref", "virtual-block-ref", "text", "file-annotation-ref", "inline-math",
+ "inline-memo", "", "backslash"].includes(item)) {
return;
}
- this.element.querySelector(`[data-type="${item}"]`).classList.add("protyle-toolbar__item--current");
+ const itemElement = this.element.querySelector(`[data-type="${item}"]`);
+ if (itemElement) {
+ itemElement.classList.add("protyle-toolbar__item--current");
+ }
});
}