Draft
Conversation
Co-authored-by: pmeinhardt <706519+pmeinhardt@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for highlighted block-quotes in Markdown
Support GitHub-style alert block-quotes
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
markdowncrate renders GitHub-style alert syntax (> [!NOTE],> [!TIP], etc.) as plain<blockquote>elements. The preview template already ships with the GitHub Markdown CSS rules for.markdown-alert-*— they just never get applied.Approach
Post-process the HTML output in
markdown::convert()to detect and rewrite matching blockquotes. No new dependencies.The five recognized types —
NOTE,TIP,IMPORTANT,WARNING,CAUTION(case-insensitive) — are transformed from:into:
Changes
src/markdown.rstransform_alerts()— scans HTML for<blockquote>\n<p>[!TYPE]and rewrites recognized alert blocks; unrecognized types and plain blockquotes are left untouchedextract_alert_content()— normalizes the two paragraph layouts themarkdowncrate can produce (type + content in same<p>vs. type as its own<p>)title_case()— formats the label string ("NOTE"→"Note")examples/alerts.in/alerts.md+examples/alerts.md— trycmd snapshot covering all five alert typesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.