Skip to content

Add GitHub-style markdown alert blocks#358

Merged
simonhamp merged 1 commit intomainfrom
markdown-alert-blocks
Apr 13, 2026
Merged

Add GitHub-style markdown alert blocks#358
simonhamp merged 1 commit intomainfrom
markdown-alert-blocks

Conversation

@simonhamp
Copy link
Copy Markdown
Member

@simonhamp simonhamp commented Apr 13, 2026

Summary

  • Add AlertBlockQuoteRenderer that detects [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION] markers in blockquotes and renders them as styled alert divs with SVG icons
  • Register the renderer in CommonMark.php with priority 10 (runs before the default blockquote renderer, falls through for regular blockquotes)
  • Add gradient background CSS matching the existing <aside> design pattern, with per-type color variants and dark mode support
  • Convert <aside> blocks in the mobile v3 security docs page to use the new alert syntax as a demonstration
  • Add 12 tests covering all alert types, regular blockquotes, inline formatting, multi-paragraph content, and edge cases

Test plan

  • php artisan test --compact tests/Feature/AlertBlockQuoteRendererTest.php — 12 tests pass
  • Verify alerts render correctly on /docs/mobile/3/concepts/security in light mode
  • Verify alerts render correctly in dark mode
  • Check that plugin README pages with GitHub alert syntax render correctly

🤖 Generated with Claude Code

Support [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], and [!CAUTION]
blockquote syntax with styled alert rendering, SVG icons, and
gradient backgrounds matching the existing aside design. Convert
security docs page asides to use the new alert syntax.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review April 13, 2026 01:31
@simonhamp simonhamp merged commit 061691d into main Apr 13, 2026
2 checks passed
@simonhamp simonhamp deleted the markdown-alert-blocks branch April 13, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant