diff --git a/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/LiveEditor/index.tsx b/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/LiveEditor/index.tsx index e8c431954..612a449ee 100644 --- a/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/LiveEditor/index.tsx +++ b/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/LiveEditor/index.tsx @@ -51,7 +51,7 @@ function App({ ...props }: any): JSX.Element { const prismTheme = usePrismTheme(); - const [code, setCode] = React.useState(children); + const [code, setCode] = React.useState(children.replace(/\n$/, "")); useEffect(() => { action(setStringRawBody(code)); @@ -76,7 +76,7 @@ function App({ })} > `${code};`)} theme={prismTheme} language={language} @@ -84,7 +84,9 @@ function App({ > (