Switch markdown conversion from Python-Markdown to cmark-gfm#13448
Merged
Switch markdown conversion from Python-Markdown to cmark-gfm#13448
Conversation
Use cmark-gfm for full GFM rendering (tables, autolink, strikethrough, tasklists), with a post-processing step that converts GFM alert syntax (> [!NOTE], > [!WARNING], etc.) into styled admonition blocks.
af85a90 to
d5031a0
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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.
Switch from Python-Markdown to cmark-gfm for converting
.mdfiles to HTML. This gives full GFM rendering (tables, autolink, strikethrough, tasklists) using the same parser GitHub itself uses.A post-processing step converts GFM alert syntax (
> [!NOTE],> [!WARNING], etc.) into styled admonition blocks with color-coded borders — blue for note/tip, purple for important, red for warning/caution. This is the same approach GitHub takes: cmark-gfm renders them as blockquotes, then a post-processor converts them to alerts.pip install markdown markdown-gfm-admonitionwithapt install cmark-gfm+pip install bikeshedbuild-markdown.pyto shell out tocmark-gfminstead of using the Python-Markdown library