Skip to content

feat: implement GFM alerts#81

Open
Proximyst wants to merge 1 commit intojfernandez:mainfrom
Proximyst:mariell/issue-80
Open

feat: implement GFM alerts#81
Proximyst wants to merge 1 commit intojfernandez:mainfrom
Proximyst:mariell/issue-80

Conversation

@Proximyst
Copy link
Copy Markdown

@Proximyst Proximyst commented Apr 12, 2026

This takes an approach somewhat similar to #55, as it seems you're pretty alright with it.

I figured that doing the replacements in-place is a little nicer of an API, but happy to make it purer like #55 does if you prefer that. Just say the word :)

Catppuccin Latte image
Catppuccin Macchiato image
Catppuccin Mocha image
Light image
Dark image

Fixes: #80

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b6977c74f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app.rs
Comment on lines +137 to +140
let Some(rel_end) = html[inner_start..].find("</blockquote>") else {
break;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match closing blockquote with nesting-aware parsing

This loop identifies a blockquote’s end via the first </blockquote> after inner_start, which is incorrect when the blockquote contains a nested blockquote. In that case, rel_end points to the inner close tag, so the replacement range is truncated; for an alert like > [!NOTE] containing a nested quote, the transform can emit malformed HTML (leaving an unmatched outer </blockquote>) and also skip transforming nested alerts. A nesting-aware matcher (or HTML parser) is needed here.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This actually seems to align with GitHub's own parser:
image
(from Gist)

image

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.

Support GFM's alerts/callouts/admonitions

1 participant