docs: format MD and MDX docs#22000
docs: format MD and MDX docs#22000adamalston wants to merge 3 commits intocarbon-design-system:mainfrom
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22000 +/- ##
==========================================
- Coverage 95.04% 95.01% -0.03%
==========================================
Files 538 538
Lines 44982 44982
Branches 6459 6459
==========================================
- Hits 42752 42739 -13
- Misses 2101 2114 +13
Partials 129 129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
devadula-nandan
left a comment
There was a problem hiding this comment.
Thanks for this pr 🎉
1 question
| <Button | ||
| renderIcon={(props) => <Add size={24} {...props} />} | ||
| iconDescription="Add"> | ||
| Add | ||
| </Button> | ||
| <Button | ||
| renderIcon={(props) => <TrashCan size={24} {...props} />} | ||
| kind="danger" | ||
| iconDescription="TrashCan"> | ||
| Delete | ||
| </Button> |
There was a problem hiding this comment.
Do you have any idea why formatting this mdx file is messing up the buttons content placing them in p tag?
Screen.Recording.2026-04-13.at.4.01.34.PM.mov
I have observed this in an other pr and avoided formatting the mdx there.
#21390 (comment)
I am not sure if there are any more cases like this in other mdx files.
Will wrapping them in storybook unstyled fixes them? could be related to these efforts 🤔
There was a problem hiding this comment.
This could be an issue with storybook mdx parsing too. But need to verify.
There was a problem hiding this comment.
There's a rendering issue with MDX parsing. Newline separated text within JSX can be interpreted as Markdown, causing it to render as p elements. I updated the code to use JavaScript expression children so the content is treated as plain text nodes.
https://mdxjs.com/docs/what-is-mdx/#interleaving
storybookjs/storybook#18921
I am not sure if there are any more cases like this in other mdx files.
There are. Would you like me to fix them here or in a separate pull request? Adding an MDX lint rule for multiline text children in JSX may help prevent similar issues in the future.
carbon/packages/react/src/components/Button/Button.mdx
Lines 288 to 292 in c6180bd
carbon/packages/react/src/components/ClassPrefix/ClassPrefix.mdx
Lines 67 to 69 in c6180bd
carbon/packages/react/src/components/ComposedModal/ComposedModal.mdx
Lines 122 to 137 in c6180bd
carbon/packages/react/src/components/ComposedModal/ComposedModal.mdx
Lines 257 to 273 in c6180bd
carbon/packages/react/src/components/Modal/Modal.mdx
Lines 125 to 140 in c6180bd
carbon/packages/react/src/components/Modal/Modal.mdx
Lines 260 to 276 in c6180bd
There was a problem hiding this comment.
Great findings!
thanks for looking into this.
fixing the lint rules in a seperate pr makes sense to me
No issue.
Formatted MD and MDX docs.
Changelog
New
lint-staged.Changed
Removed
max_line_lengthproperty in.editorconfig. That property isn't supported per https://editorconfig.org/#supported-properties.Testing / Reviewing
An example of an issue the changes in this pull request fix is in https://github.com/carbon-design-system/carbon/blob/597001a9b6710da9531883b65a0852fde9ff199d/docs/guides/reviewing-pull-requests.md. The alert at the top of the file isn't rendered due to an issue with the way it's written.
I left a
TODOwith a question. I'm curious if anyone has any input. If there is no clear answer, I can try removing the component in a follow-up to determine whether it's still needed.PR Checklist
As the author of this PR, before marking ready for review, confirm you:
Wrote passing tests that cover this changeAddressed any impact on accessibility (a11y)Tested for cross-browser consistencyMore details can be found in the pull request guide