From 70006beeb9d7523a9aa5ce40617b4e7303773a5e Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Thu, 1 Jan 2026 21:51:39 +0700 Subject: [PATCH] fix: button rendering consistency between visual and preview Root cause: parseCardsForPreview was called TWICE in generatePreviewHTML: 1. Line 179 - correctly parses markdown to HTML including buttons 2. Line 283 - redundantly called AGAIN after variable highlighting After first call, variable highlighting (lines 275-280) replaced unknown variables like {login_url} with [login_url]. When the second parseCardsForPreview ran, the [login_url] text was misinterpreted as shortcode syntax, corrupting button HTML output. Fix: Remove the redundant second call to parseCardsForPreview at line 283. The function is already called at line 179 before any variable replacement. --- admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx index 74684fa..60e5a5c 100644 --- a/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx +++ b/admin-spa/src/routes/Settings/Notifications/EditTemplate.tsx @@ -279,9 +279,6 @@ export default function EditTemplate() { } }); - // Parse [card] tags - previewBody = parseCardsForPreview(previewBody); - // Get email settings for preview const settings = emailSettings || {}; const primaryColor = settings.primary_color || '#7f54b3';