feat(remark): add alert support#832
Conversation
PR SummaryLow Risk Overview A new remark plugin ( Unit tests cover all five GitHub alert types, body preservation, marker-only paragraphs, and passthrough for normal quotes and unknown markers. Reviewed by Cursor Bugbot for commit 7818956. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #832 +/- ##
==========================================
+ Coverage 84.34% 84.48% +0.14%
==========================================
Files 172 174 +2
Lines 15447 15632 +185
Branches 1368 1386 +18
==========================================
+ Hits 13028 13207 +179
- Misses 2409 2415 +6
Partials 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds native support for GitHub-style Markdown alerts (> [!NOTE], > [!WARNING], etc.) in the JSX/Recma rendering pipeline by rewriting matching blockquotes into AlertBox MDX JSX elements.
Changes:
- Add a Remark plugin that detects GitHub alert markers in blockquotes and converts them into
AlertBoxcomponents. - Wire the new alert transform into the
getRemarkRecmaunified pipeline used for JSX generation. - Extend JSX-AST constants with GitHub alert mappings + marker regex and add focused unit tests for both the new alerts plugin and the existing transformer behavior.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/remark.mjs | Registers the new alert transform in the Recma/JSX unified pipeline and updates transformer import path. |
| src/generators/jsx-ast/utils/plugins/transformer.mjs | Adjusts constants import path after relocating transformer into the plugins/ directory. |
| src/generators/jsx-ast/utils/plugins/alerts.mjs | New Remark plugin converting > [!…] alert blockquotes into AlertBox MDX JSX elements. |
| src/generators/jsx-ast/utils/plugins/tests/transformer.test.mjs | Adds a unit test covering the footnotes relocation behavior in the transformer plugin. |
| src/generators/jsx-ast/utils/plugins/tests/alerts.test.mjs | Adds unit tests validating alert marker detection, mapping, and marker stripping behavior. |
| src/generators/jsx-ast/constants.mjs | Adds NEUTRAL level and defines GitHub alert keyword → AlertBox level mapping + marker regex. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #831: