From 090262d278c4d32d998929d2e699038aae1d04c3 Mon Sep 17 00:00:00 2001 From: zqlit Date: Mon, 5 Oct 2026 07:46:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(autofill):=20=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E9=80=89=E6=8B=A9=E5=99=A8=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=20.atk-main-editor=EF=BC=8C=E7=BA=BF=E4=B8=8A=20Artalk=20DOM?= =?UTF-8?q?=20=E9=87=8C=E6=B2=A1=E6=9C=89=20.atk-editor=EF=BC=8C=E5=A7=94?= =?UTF-8?q?=E6=89=98=E5=8C=B9=E9=85=8D=E4=B8=8D=E5=88=B0=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=A9=BA=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Ying/assets/js/modules/comment-autofill.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/Ying/assets/js/modules/comment-autofill.js b/themes/Ying/assets/js/modules/comment-autofill.js index 998f72f1..4f24f46c 100644 --- a/themes/Ying/assets/js/modules/comment-autofill.js +++ b/themes/Ying/assets/js/modules/comment-autofill.js @@ -33,8 +33,11 @@ function isEmail(s) { return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(s || '').trim()); } function editorOf(el) { - var box = el && el.closest ? el.closest('.atk-editor') : null; - return box || null; + // 线上 Artalk 的编辑器容器是 .atk-main-editor(旧版/别处可能是 .atk-editor), + // 兜底再往上找整个 .artalk 根 —— 宁可范围大一点,也别让委托匹配不到 + return (el && el.closest) + ? el.closest('.atk-main-editor, .atk-editor, .artalk, .atk-layer-wrap') + : null; } function fieldIn(editor, name) {