mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 13:22:26 +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();
|
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)) {
|
if (metastring && highlightLinesRangeRegex.test(metastring)) {
|
||||||
// Tested above
|
// Tested above
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue