From 820fadc3f2c4b3d1cc1b86a15bc4ac7ff6ef59fa Mon Sep 17 00:00:00 2001 From: QiuYuang Date: Mon, 29 Jun 2026 09:51:29 +0800 Subject: [PATCH] fix(template): resolve variable shadowing in export-html template --- src/auto-reply/reply/export-html/template.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/auto-reply/reply/export-html/template.js b/src/auto-reply/reply/export-html/template.js index 464209129884..602ac03b1dbd 100644 --- a/src/auto-reply/reply/export-html/template.js +++ b/src/auto-reply/reply/export-html/template.js @@ -699,11 +699,11 @@ return "application/octet-stream"; } - function sanitizeImageBase64(data) { - if (typeof data !== "string") { + function sanitizeImageBase64(base64Data) { + if (typeof base64Data !== "string") { return ""; } - const cleaned = data.replace(/\s+/g, ""); + const cleaned = base64Data.replace(/\s+/g, ""); if (!cleaned || cleaned.length % 4 !== 0 || !SAFE_BASE64_RE.test(cleaned)) { return ""; } @@ -712,11 +712,11 @@ function renderDataUrlImage(img, className) { const mimeType = sanitizeImageMimeType(img?.mimeType); - const base64 = sanitizeImageBase64(img?.data); - if (!base64) { + const imgBase64 = sanitizeImageBase64(img?.data); + if (!imgBase64) { return ""; } - return ``; + return ``; } /** * Truncate string to maxLen chars, append "..." if truncated. @@ -864,8 +864,8 @@ div.appendChild(content); // Navigate to the newest leaf through this node, but scroll to the clicked node div.addEventListener("click", () => { - const leafId = findNewestLeaf(entry.id); - navigateTo(leafId, "target", entry.id); + const targetLeafId = findNewestLeaf(entry.id); + navigateTo(targetLeafId, "target", entry.id); }); container.appendChild(div);