-
Notifications
You must be signed in to change notification settings - Fork 2
fix: render unsupported directives as text #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 8c89492 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update introduces a patch changeset for the Changes
Sequence Diagram(s)sequenceDiagram
participant MarkdownParser
participant remarkDirectives
participant AST
participant MarkdownSerializer
MarkdownParser->>remarkDirectives: Parse markdown with directives
remarkDirectives->>AST: Traverse directive nodes
AST-->>remarkDirectives: Encounter unknown directive node
remarkDirectives->>MarkdownSerializer: Serialize unknown directive to markdown text
MarkdownSerializer-->>remarkDirectives: Return markdown text node
remarkDirectives->>AST: Replace unknown directive with text node
Estimated code review effort2 (~15 minutes) Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/plugins/directives/remark-directives.tsOops! Something went wrong! :( ESLint: 9.31.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/eslint.js' imported from /eslint.config.js 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
🧠 Learnings (4)📓 Common learnings.changeset/light-bears-judge.md (6)Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin src/plugins/directives/remark-directives.ts (1)Learnt from: JounQin package.json (7)Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin 🧰 Additional context used🧠 Learnings (4)📓 Common learnings.changeset/light-bears-judge.md (6)Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin src/plugins/directives/remark-directives.ts (1)Learnt from: JounQin package.json (7)Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin Learnt from: JounQin 🔇 Additional comments (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the handling of unsupported directives by rendering them as text instead of silently ignoring them. The key changes include updating the directive processing logic to convert unsupported directives to markdown text, adding required dependencies, and including a test fixture.
- Updates the remark directive plugin to convert unsupported directives to text nodes using markdown utilities
- Adds
mdast-util-directiveandmdast-util-to-markdowndependencies for directive-to-text conversion - Various dependency version updates for maintenance
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/plugins/directives/remark-directives.ts | Modified to render unsupported directives as text instead of returning early |
| package.json | Added new dependencies and updated existing package versions |
| fixture-docs/zh/directive.mdx | Added test fixture for directive handling |
Signed-off-by: JounQin <admin@1stg.me>
commit: |
Summary by CodeRabbit
Bug Fixes
Chores