Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/10753

Vanessa284ec21b3be7
diff --git a/app/src/assets/scss/component/_menu.scss b/app/src/assets/scss/component/_menu.scss
index f8ceaadd06..10380fcafd 100644
--- a/app/src/assets/scss/component/_menu.scss
+++ b/app/src/assets/scss/component/_menu.scss
@@ -120,6 +120,8 @@
white-space: break-spaces;
line-height: 26px;
margin: 8px 0;
+ // 移动端面包屑过长
+ word-wrap: break-word;
}
&__icon {
diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts
index 6fa4a03488..8ecc8e543c 100644
--- a/app/src/protyle/breadcrumb/index.ts
+++ b/app/src/protyle/breadcrumb/index.ts
@@ -31,6 +31,7 @@ import {emitOpenMenu} from "../../plugin/EventBus";
import {isInAndroid, isIPad, isMac, updateHotkeyTip} from "../util/compatibility";
import {resize} from "../util/resize";
import {listIndent, listOutdent} from "../wysiwyg/list";
+import {escapeAttr, escapeHtml} from "../../util/escape";
export class Breadcrumb {
public element: HTMLElement;
@@ -243,7 +244,7 @@ ${padHTML}
menu.addItem({
current: isCurrent,
icon: getIconByType(item.type, item.subType),
- label: item.name,
+ label: escapeHtml(item.name),
click() {
zoomOut({protyle, id: item.id, focusId: id});
}
@@ -618,7 +619,7 @@ ${padHTML}
} else {
html += `<span class="protyle-breadcrumb__item${isCurrent ? " protyle-breadcrumb__item--active" : ""}" data-node-id="${item.id}"${(response.data.length === 1 || index === 0) ? ' style="max-width:none"' : ""}>
<svg class="popover__block" data-id="${item.id}"><use xlink:href="#${getIconByType(item.type, item.subType)}"></use></svg>
- <span class="protyle-breadcrumb__text" title="${item.name}">${item.name}</span>
+ <span class="protyle-breadcrumb__text" title="${escapeAttr(item.name)}">${escapeHtml(item.name)}</span>
</span>`;
}
if (index !== response.data.length - 1) {