mirror of
https://github.com/YuleBest/FontMM.git
synced 2026-12-04 03:11:48 +08:00
fix(webui): 编辑测试文本时输入框出现空行 (close #16)
测试文本节点的 textContent 含 HTML 标签间的缩进与换行, 原样填入文本域后 会显示成首尾各一个空行。填入前 trim 掉。
This commit is contained in:
1 parent
df339a0611
commit
010a18973e
1 file changed
+2
-1
@@ -174,7 +174,8 @@ document.querySelectorAll<HTMLElement>('.test-card-editable').forEach((card) =>
|
||||
const target = document.getElementById(targetId);
|
||||
if (!target) return;
|
||||
editTargetId = targetId;
|
||||
editInput.value = target.textContent ?? '';
|
||||
// trim: textContent 带着标签间的缩进与换行, 原样填入会在输入框里显示成空行 (issue #16)
|
||||
editInput.value = (target.textContent ?? '').trim();
|
||||
if (editDialog) editDialog.open = true;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user