Skip to content

Commit bda4309

Browse files
committed
refactor: improve shortcode handling and parsing logic
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
1 parent 830ac88 commit bda4309

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/remark-hugo-shortcodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ShortcodeRegistry {
5959
const src = attrs.src || '';
6060
const alt = this.escapeHtml(attrs.alt || '');
6161
const width = attrs.width || '100%';
62-
const showCaption = attrs.showCaption !== 'false';
62+
const showCaption = attrs.showCaption === 'true';
6363

6464
const imageHtml = `<img src="${src}" alt="${alt}" style="display: block; max-width: ${width}; height: auto; margin-left: auto; margin-right: auto; border-radius: 0.75rem;" />`;
6565
const captionHtml = showCaption && alt ? `<p style="text-align: center; font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem;">${alt}</p>` : '';

0 commit comments

Comments
 (0)