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 <span>[login_url]</span>. 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.
This commit is contained in:
Dwindi Ramadhana
2026-01-01 21:51:39 +07:00
parent e84fa969bb
commit 70006beeb9

View File

@@ -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';