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:
@@ -279,9 +279,6 @@ export default function EditTemplate() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Parse [card] tags
|
|
||||||
previewBody = parseCardsForPreview(previewBody);
|
|
||||||
|
|
||||||
// Get email settings for preview
|
// Get email settings for preview
|
||||||
const settings = emailSettings || {};
|
const settings = emailSettings || {};
|
||||||
const primaryColor = settings.primary_color || '#7f54b3';
|
const primaryColor = settings.primary_color || '#7f54b3';
|
||||||
|
|||||||
Reference in New Issue
Block a user