From 4a17a114f3f9f18a6bef99a0ad17a0de1d865127 Mon Sep 17 00:00:00 2001 From: devleejb Date: Wed, 18 Sep 2024 19:12:36 +0900 Subject: [PATCH] Fix excessive line break --- frontend/src/utils/document.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/utils/document.ts b/frontend/src/utils/document.ts index 0b219944..0cebbe03 100644 --- a/frontend/src/utils/document.ts +++ b/frontend/src/utils/document.ts @@ -5,6 +5,9 @@ export function createDocumentKey() { export function addSoftLineBreak(text: string) { return text .split("\n") - .map((line) => line + " ") + .map((line) => { + if (line.trim() === "") return ""; + else return line + " "; + }) .join("\n"); }