mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 12:22:45 +02:00
fix(v2): add support for interleaving Markdown in code blocks (#3749)
* fix(v2): add support for interleaving Markdown in code blocks * Improve check for array
This commit is contained in:
parent
30d7408815
commit
1dac7e33f7
1 changed files with 5 additions and 0 deletions
|
@ -112,6 +112,11 @@ export default ({
|
|||
|
||||
const prismTheme = usePrismTheme();
|
||||
|
||||
// In case interleaved Markdown (e.g. when using CodeBlock as standalone component).
|
||||
if (Array.isArray(children)) {
|
||||
children = children.join('');
|
||||
}
|
||||
|
||||
if (metastring && highlightLinesRangeRegex.test(metastring)) {
|
||||
// Tested above
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue