fix: resolve code block rendering issues in api_components.mdx#5270
fix: resolve code block rendering issues in api_components.mdx#5270wei123-web wants to merge 2 commits intoasyncapi:masterfrom
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughA new MDX documentation page Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5270--asyncapi-website.netlify.app/ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5270 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 796 830 +34
Branches 146 159 +13
=========================================
+ Hits 796 830 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pages/docs/tools/generator/api_components.mdx`:
- Around line 242-243: The file ends without a trailing newline after the final
code block that contains renderUsage(); — add a single trailing newline
character at the end of the file (i.e., insert an empty line after the closing
triple backticks of the code fence that contains renderUsage()) so the file ends
with '\n'.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bb7ef892-d1f1-41e9-b176-9c3972a9ce11
📒 Files selected for processing (1)
pages/docs/tools/generator/api_components.mdx
animeshk923
left a comment
There was a problem hiding this comment.
@wei123-web
Issue still exists. See the codeblocks here: https://deploy-preview-5270--asyncapi-website.netlify.app/docs/tools/generator/api_components#coremethods
|
|
@animeshk923 Got it I’ll take another look at the rendering issue an update soon. |




Fixes #5160
Root Cause
The code block rendering issues were caused by two problems:
api_components.mdxfile was missing frompages/docs/tools/generator/importinside JSX (<Component />) highlights differently than plain JS. This is handled by the syntax highlighter theme inCodeBlock.tsx.Changes
api_components.mdxtopages/docs/tools/generator/jslanguage tags on all code blocks to fix color inconsistencyHow to test
npm run devhttp://localhost:3000/docs/tools/generator/api_componentsNote
The slight color difference on
importkeyword inside JSX blocks is a known Prism.js behavior and may require a separate fix inCodeBlock.tsxif maintainers decide it needs addressing.Summary by CodeRabbit