fix(v2): add support for interleaving Markdown in code blocks#3749
Merged
fix(v2): add support for interleaving Markdown in code blocks#3749
Conversation
|
Deploy preview for docusaurus-2 ready! Built with commit 5ad20d6 |
dio
reviewed
Nov 14, 2020
Comment on lines
116
to
118
| if (typeof children !== 'string') { | ||
| children = (children as string[]).join(''); | ||
| } |
There was a problem hiding this comment.
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.
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
|
Probably good for merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.)