From 8959af82702655a2225611ce901a457685fb476a Mon Sep 17 00:00:00 2001 From: Dwindi Ramadhana Date: Thu, 1 Jan 2026 23:49:33 +0700 Subject: [PATCH] fix: remove hardcoded center alignment from button preview parseCardsForPreview was forcing text-align: center on all buttons regardless of user alignment choice. Removed the hardcoded style so buttons follow natural document flow alignment. --- admin-spa/src/lib/markdown-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-spa/src/lib/markdown-utils.ts b/admin-spa/src/lib/markdown-utils.ts index dbb568f..a85f370 100644 --- a/admin-spa/src/lib/markdown-utils.ts +++ b/admin-spa/src/lib/markdown-utils.ts @@ -98,13 +98,13 @@ export function markdownToHtml(markdown: string): string { // Parse [button:style](url)Text[/button] (new syntax) html = html.replace(/\[button:(\w+)\]\(([^)]+)\)([^\[]+)\[\/button\]/g, (match, style, url, text) => { const buttonClass = style === 'outline' ? 'button-outline' : 'button'; - return `

${text.trim()}

`; + return `

${text.trim()}

`; }); // Parse [button url="..."] shortcodes (old syntax - backward compatibility) html = html.replace(/\[button\s+url="([^"]+)"(?:\s+style="([^"]+)")?\]([^\[]+)\[\/button\]/g, (match, url, style, text) => { const buttonClass = style === 'outline' ? 'button-outline' : 'button'; - return `

${text.trim()}

`; + return `

${text.trim()}

`; }); // Parse remaining markdown