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/14865

Vanessaa48e78d55f56
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index e856cc1065..e416f51c83 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -519,7 +519,13 @@ export class Toolbar {
if (item.textContent) {
const inlineElement = document.createElement("span");
inlineElement.setAttribute("data-type", type);
- inlineElement.textContent = type === "a" ? (item.textContent.trim() || "*") : item.textContent;
+ inlineElement.textContent = item.textContent;
+ if (type === "a") {
+ if (!inlineElement.textContent) {
+ inlineElement.textContent = "*";
+ }
+ textObj.color = textObj.color.split(Constants.ZWSP)[0];
+ }
setFontStyle(inlineElement, textObj);
if (type === "text" && !inlineElement.getAttribute("style")) {
@@ -605,6 +611,12 @@ export class Toolbar {
types = [...new Set(types)];
if (item.tagName !== "BR" && item.tagName !== "IMG" && !types.includes("img")) {
item.setAttribute("data-type", types.join(" "));
+ if (type === "a") {
+ if (!item.textContent) {
+ item.textContent = "*";
+ }
+ textObj.color = textObj.color.split(Constants.ZWSP)[0];
+ }
setFontStyle(item, textObj);
if (types.includes("text") && !item.getAttribute("style")) {
if (types.length === 1) {