Skip to content

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

:bug: Preserve names in search updates and history dialogs https://github.com/siyuan-note/siyuan/issues/19387

Vanessadfa2c589f246
diff --git a/app/src/history/doc.ts b/app/src/history/doc.ts
index 41eeac320a..6f4e6a9257 100644
--- a/app/src/history/doc.ts
+++ b/app/src/history/doc.ts
@@ -225,7 +225,7 @@ export const openDocHistory = (options: {
</div>
</div>`;
const dialog = new Dialog({
- title: options.pathString,
+ title: escapeHtml(options.pathString),
content: contentHTML,
width: isMobile() ? "100vw" : "90vw",
height: isMobile() ? "100dvh" : "80vh",
diff --git a/app/src/history/history.ts b/app/src/history/history.ts
index c933378672..79b602c5b1 100644
--- a/app/src/history/history.ts
+++ b/app/src/history/history.ts
@@ -976,7 +976,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
break;
} else if (type === "removeRepoTagSnapshot" || type === "removeCloudRepoTagSnapshot") {
const tag = target.parentElement.getAttribute("data-tag");
- confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} <i>${escapeHtml(tag)}</i>?`, () => {
+ confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} <b>${escapeHtml(tag)}</b> ?`, () => {
fetchPost("/api/repo/" + type, {tag}, () => {
renderRepo(repoElement, 1);
});
diff --git a/app/src/search/menu.ts b/app/src/search/menu.ts
index dfecb163bf..2891c11daf 100644
--- a/app/src/search/menu.ts
+++ b/app/src/search/menu.ts
@@ -415,7 +415,7 @@ const saveCriterionData = (config: Config.IUILayoutTabSearchConfig,
const criteriaElement = element.querySelector("#criteria").firstElementChild;
criteriaElement.classList.remove("fn__none");
criteriaElement.querySelector(".b3-chip--current")?.classList.remove("b3-chip--current");
- criteriaElement.insertAdjacentHTML("beforeend", `<div data-type="set-criteria" class="b3-chip b3-chip--current b3-chip--middle b3-chip--pointer">${criterion.name}<svg class="b3-chip__close" data-type="remove-criteria"><use xlink:href="#iconClose"></use></svg></div>`);
+ criteriaElement.insertAdjacentHTML("beforeend", `<div data-type="set-criteria" class="b3-chip b3-chip--current b3-chip--middle b3-chip--pointer">${escapeHtml(criterion.name)}<svg class="b3-chip__close" data-type="remove-criteria"><use xlink:href="#iconClose"></use></svg></div>`);
});
};
@@ -427,7 +427,7 @@ export const saveCriterion = (config: Config.IUILayoutTabSearchConfig,
}
const saveDialog = openInputDialog({
title: window.siyuan.languages.saveCriterion,
- value: "",
+ value: element.querySelector("#criteria .b3-chip--current")?.textContent || "",
placeholder: window.siyuan.languages.memo,
onConfirm: (inputValue, saveDialog) => {
const inputElement = saveDialog.element.querySelector("input");