From 9649ad403deefc98dd5c980ae349aaa64c0b3b8f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 12 Dec 2024 00:06:27 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/13440 --- app/src/protyle/header/Background.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index e5cba295b..85e1f1e8e 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -443,8 +443,8 @@ export class Background { if (tags) { let html = ""; const colors = ["secondary", "primary", "info", "success", "warning", "error", "pink"]; - tags.split(",").forEach((item, index) => { - if (!item) { + new Set(tags.split(",")).forEach((item, index) => { + if (!item.replace(/ /g, "")) { return; } html += `
${escapeHtml(item)}
`; @@ -542,7 +542,7 @@ export class Background { this.addTags(inputElement.value, protyle); } inputElement.value = ""; - inputElement.dispatchEvent(new CustomEvent("input")); + inputElement.dispatchEvent(new CustomEvent("input")); } else if (event.key === "Escape") { window.siyuan.menus.menu.remove(); }