File tree 2 files changed +6
-2
lines changed
docusaurus-theme-common/src/utils
docusaurus-theme-live-codeblock/src/theme/Playground
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ export function parseCodeBlockMetaOptions(
433
433
434
434
// interactive code editor (theme-live-codeblock => Playground)
435
435
parsedOptions . live = metastring ?. split ( ' ' ) . includes ( 'live' ) ;
436
- // parsedOptions.noInline = TODO ;
436
+ parsedOptions . noInline = metastring ?. includes ( 'noInline' ) ;
437
437
438
438
return parsedOptions ;
439
439
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
16
16
ErrorBoundaryErrorMessageFallback ,
17
17
usePrismTheme ,
18
18
} from '@docusaurus/theme-common' ;
19
+ import { parseCodeBlockMetaOptions } from '@docusaurus/theme-common/internal' ;
19
20
import ErrorBoundary from '@docusaurus/ErrorBoundary' ;
20
21
21
22
import type { Props } from '@theme/Playground' ;
@@ -105,6 +106,8 @@ const DEFAULT_TRANSFORM_CODE = (code: string) => `${code};`;
105
106
export default function Playground ( {
106
107
children,
107
108
transformCode,
109
+ metastring,
110
+ metaOptions : metaOptionsProp ,
108
111
...props
109
112
} : Props ) : ReactNode {
110
113
const {
@@ -115,7 +118,8 @@ export default function Playground({
115
118
} = themeConfig as ThemeConfig ;
116
119
const prismTheme = usePrismTheme ( ) ;
117
120
118
- const noInline = props . metastring ?. includes ( 'noInline' ) ?? false ;
121
+ const metaOptions = parseCodeBlockMetaOptions ( metastring , metaOptionsProp ) ;
122
+ const noInline = ! ! metaOptions . noInline ;
119
123
120
124
return (
121
125
< div className = { styles . playgroundContainer } >
You can’t perform that action at this time.
0 commit comments