From a5550e57526b0eba18d5eea5f28130655a979fdd Mon Sep 17 00:00:00 2001 From: kdh8219 <65698239+kdh8219@users.noreply.github.com> Date: Fri, 5 May 2023 22:45:01 +0900 Subject: [PATCH] fix #7 --- src/functions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/functions.ts b/src/functions.ts index 72db536..365271f 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -25,11 +25,12 @@ export function dmSlice(raw: string): string[] { let front = txt.slice(0, 2000); let end = txt.slice(2000, txt.length); if (end) { - let toLastNextLine = - "ㅤ" /* 공백문자 */ + - front.slice(front.lastIndexOf("\n"), front.length); + let toLastNextLine = front.slice(front.lastIndexOf("\n"), front.length); front = front.slice(0, front.lastIndexOf("\n")); end = toLastNextLine + end; + if (end.slice(0, 1) == "\n") { + end = "ㅤ" /* 공백문자 */ + end; + } } return { front, end }; }