Skip to content

Commit

Permalink
fix(docs): remove trailing newline from codepreview
Browse files Browse the repository at this point in the history
  • Loading branch information
mfal committed Jan 29, 2024
1 parent 30bebea commit 95284d4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ const LiveCodeEditor: FC<LiveCodeEditorProps> = (props) => {
}
};

const codeToDisplay = code.replace(/\r?\n$/, "");

return (
<LiveProvider code={code} scope={scope} transformCode={transformCode}>
<LiveProvider
code={codeToDisplay}
scope={scope}
transformCode={transformCode}
>
<div className={styles.root}>
<LivePreview className={styles.preview} />
<div className={styles.editorContainer}>
Expand Down

0 comments on commit 95284d4

Please sign in to comment.