Conversation
There was a problem hiding this comment.
💡 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".
| let Some(rel_end) = html[inner_start..].find("</blockquote>") else { | ||
| break; | ||
| }; | ||
|
|
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
This actually seems to align with GitHub's own parser:

(from Gist)
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
Catppuccin Macchiato
Catppuccin Mocha
Light
Dark
Fixes: #80