-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
fix(v2): add support for interleaving Markdown in code blocks #3749
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 5ad20d6 |
if (typeof children !== 'string') { | ||
children = (children as string[]).join(''); | ||
} |
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.
Awesome!
Yeah, I have a fork of CodeBlock as a @site level component doing this. What do you think of having Array.isArray
checking instead (since we'll do joining)?
if (Array.isArray(children))
And should we introduce a new local var? Not sure about the style for rewriting args.
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.
Agree that I'd rather have an isArray check here, but in practice it probably does not change much
Size Change: +24 B (0%) Total Size: 152 kB ℹ️ View Unchanged
|
e299007
to
5ad20d6
Compare
Probably good for merging. |
Motivation
Fixes #3746
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Try to put the following MDX snippet into the document and make sure it renders correctly.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)