From 010a18973eaf222ad4ce9fb9d850beb32c310012 Mon Sep 17 00:00:00 2001 From: YuleBest Date: Wed, 16 Sep 2026 15:34:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(webui):=20=E7=BC=96=E8=BE=91=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=96=87=E6=9C=AC=E6=97=B6=E8=BE=93=E5=85=A5=E6=A1=86?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=A9=BA=E8=A1=8C=20(close=20#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试文本节点的 textContent 含 HTML 标签间的缩进与换行, 原样填入文本域后 会显示成首尾各一个空行。填入前 trim 掉。 --- web/src/testFonts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/testFonts.ts b/web/src/testFonts.ts index f825165..948da80 100644 --- a/web/src/testFonts.ts +++ b/web/src/testFonts.ts @@ -174,7 +174,8 @@ document.querySelectorAll('.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; }); });