Compare commits

..

2 Commits

Author SHA1 Message Date
seaislee1209
db1bbfa1d4 Merge branch 'dev' of https://gitea.airlabs.art/zyc/video-shuoshan into dev
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
2026-04-04 22:18:54 +08:00
seaislee1209
4b2dd9ef5e fix: 音频 ♫ 符号溢出到 prompt 文本 — 改用 CSS ::before 渲染
createMentionSpan 里音频的 ♫ 之前用 textContent 设置,
被 extractText() 的 el.textContent 读进了 prompt 纯文本,
导致 renderPromptWithMentions 匹配后留下额外的 ♫ 字符。

改用 CSS ::before content 渲染,不参与 textContent,
prompt 里不再有多余的 ♫。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:17:07 +08:00
2 changed files with 14 additions and 2 deletions

View File

@ -46,6 +46,18 @@
transition: background 0.15s, opacity 0.15s; transition: background 0.15s, opacity 0.15s;
} }
.mentionAudioIcon {
display: inline-block;
margin-right: 3px;
font-size: 13px;
vertical-align: middle;
pointer-events: none;
}
.mentionAudioIcon::before {
content: '\266B'; /* ♫ rendered via CSS, not textContent — avoids polluting prompt text */
}
.mentionImg { .mentionImg {
width: 16px; width: 16px;
height: 16px; height: 16px;

View File

@ -88,8 +88,8 @@ export function PromptInput() {
const isAudio = opts.refType === 'audio' || opts.assetType === 'Audio'; const isAudio = opts.refType === 'audio' || opts.assetType === 'Audio';
if (isAudio) { if (isAudio) {
const icon = document.createElement('span'); const icon = document.createElement('span');
icon.textContent = '\u266B'; icon.className = styles.mentionAudioIcon;
icon.style.cssText = 'margin-right:3px;font-size:13px;vertical-align:middle;pointer-events:none'; icon.setAttribute('aria-hidden', 'true');
span.appendChild(icon); span.appendChild(icon);
} else if (opts.thumbUrl) { } else if (opts.thumbUrl) {
const img = document.createElement('img'); const img = document.createElement('img');