An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/6502
Vanessa081cb8b1ccf5
diff --git a/app/src/protyle/toolbar/Font.ts b/app/src/protyle/toolbar/Font.tsindex b5351df886..0604faa087 100644--- a/app/src/protyle/toolbar/Font.ts+++ b/app/src/protyle/toolbar/Font.ts@@ -111,12 +111,19 @@ export const fontMenu = (protyle: IProtyle) => {<option ${fontSize === "40px" ? "selected" : ""} value="40px">40px</option><option ${fontSize === "48px" ? "selected" : ""} value="48px">48px</option></select>-</div>`;+</div>+<div class="fn__hr"></div>+<button class="b3-button b3-button--cancel" data-type="clear"><svg><use xlink:href="#iconTrashcan"></use></svg>${window.siyuan.languages.clearFontStyle}</button>`;element.addEventListener(getEventName(), function (event: Event) {let target = event.target as HTMLElement;while (target && !target.isEqualNode(element)) {+ const dataType = target.getAttribute("data-type")if (target.tagName === "BUTTON") {- fontEvent(protyle, target.getAttribute("data-type"), target.style.backgroundColor || target.textContent);+ if (dataType === "clear") {+ protyle.toolbar.setInlineMark(protyle, "clear", "range", {type:"text"});+ } else {+ fontEvent(protyle, dataType, target.style.backgroundColor || target.textContent);+ }break;}target = target.parentElement;@@ -282,4 +289,5 @@ export const hasSameTextStyle = (currentElement: HTMLElement, sideElement: HTMLEtextObj.color === sideElement.style.fontSize &&backgroundColor === sideElement.style.backgroundColor;}+ return true; // 清除字体样式会使用 "text" 作为标识};diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex ed33b08554..f8ef151942 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -338,9 +338,16 @@ export class Toolbar {const types = item.getAttribute("data-type").split(" ");if (type === "clear") {for (let i = 0; i < types.length; i++) {- if (["kbd", "text", "strong", "em", "u", "s", "mark", "sup", "sub", "code"].includes(types[i])) {- types.splice(i, 1);- i--;+ if (textObj.type === "text") {+ if ("text" === types[i]) {+ types.splice(i, 1);+ i--;+ }+ } else {+ if (["kbd", "text", "strong", "em", "u", "s", "mark", "sup", "sub", "code"].includes(types[i])) {+ types.splice(i, 1);+ i--;+ }}}} else {