mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-05 04:12:53 +02:00
fix(v2): trim code block before passing to prism react renderer (#1560)
This commit is contained in:
parent
b789624d2e
commit
924668a077
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ export default ({children, className: languageClassName, live, ...props}) => {
|
||||||
return (
|
return (
|
||||||
<Playground
|
<Playground
|
||||||
scope={{...React}}
|
scope={{...React}}
|
||||||
code={children}
|
code={children.trim()}
|
||||||
theme={nightOwlTheme}
|
theme={nightOwlTheme}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
@ -35,7 +35,7 @@ export default ({children, className: languageClassName, live, ...props}) => {
|
||||||
<Highlight
|
<Highlight
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
theme={nightOwlTheme}
|
theme={nightOwlTheme}
|
||||||
code={children}
|
code={children.trim()}
|
||||||
language={language}>
|
language={language}>
|
||||||
{({className, style, tokens, getLineProps, getTokenProps}) => (
|
{({className, style, tokens, getLineProps, getTokenProps}) => (
|
||||||
<pre
|
<pre
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue