diff --git a/src/components/EditorTextArea.js b/src/components/EditorTextArea.js index bc2fa07..01394df 100644 --- a/src/components/EditorTextArea.js +++ b/src/components/EditorTextArea.js @@ -21,7 +21,13 @@ export default function EditorTextArea({ code, setCode, language, fontSize }) { )) - .reduce((prev, curr) => [prev, '\n', curr]); + .reduce((acc, curr, idx) => { + if (idx !== 0) { + acc.push('\n'); + } + acc.push(curr); + return acc; + }, []); } const autoBracketState = useState(null);