From e323f07cccb8b16c90a96c673b365c3fa66d2429 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 26 Sep 2022 22:02:05 +0800 Subject: [PATCH] :bug: toolbar --- app/src/protyle/export/index.ts | 2 +- app/src/protyle/toolbar/index.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts index f065b95ba..63495ed41 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 13c966e3f..ed11ccd36 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"); + } }); }