Skip to content

fix(shortcodes): fix markdown indented codeblock rendering and shortcode HTML structure - #82

Merged
kascit merged 1 commit into
mainfrom
fix/shortcodes-markdown-rendering
Aug 23, 2026
Merged

fix(shortcodes): fix markdown indented codeblock rendering and shortcode HTML structure#82
kascit merged 1 commit into
mainfrom
fix/shortcodes-markdown-rendering

Conversation

@kascit

@kascit kascit commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Root Cause & Fix

  • Root Cause:

    1. Shortcode templates in templates/shortcodes/ had lines with $\ge 4$ spaces of indentation or multi-line opening tags with standalone > at the beginning of a line.
    2. When Zola expands shortcodes inside Markdown documents before Markdown parsing, CommonMark rules treat $\ge 4$ leading spaces as Indented Code Blocks (<pre><code>) and standalone > as Blockquotes (<blockquote>), causing raw HTML to be escaped as text or wrapped in code blocks.
    3. Shortcodes generated multiple empty lines, closing HTML parent blocks early.
  • Solution:

    • Added whitespace suppression ({%- ... -%}) to all 31 shortcode templates.
    • Normalized all opening HTML tags to complete on a single line.
    • Eliminated $\ge 4$ spaces indentation from all shortcode outputs and raw HTML blocks in content/.
    • Verified all pages (/projects/, /links/, /about/, etc.) render clean, valid HTML with no escaped tags or code blocks.

Copilot AI lite review requested due to automatic review settings August 23, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kascit
kascit enabled auto-merge (squash) August 23, 2026 10:05
@kascit
kascit merged commit df3299a into main Aug 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants