Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/5936

Vanessa4693ee534332
diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.ts
index 35a2c9646c..bbde437ac5 100644
--- a/app/src/protyle/toolbar/Font.ts
+++ b/app/src/protyle/toolbar/Font.ts
@@ -104,7 +104,7 @@ export const fontMenu = (protyle: IProtyle) => {
let target = event.target as HTMLElement;
while (target && !target.isEqualNode(element)) {
if (target.tagName === "BUTTON") {
- fontEvent(protyle, target.getAttribute("data-type"), target.style.backgroundColor);
+ fontEvent(protyle, target.getAttribute("data-type"), target.style.backgroundColor || target.textContent);
break;
}
target = target.parentElement;