From f57cb242f22df2b907829b6f4a5cff8110e30f90 Mon Sep 17 00:00:00 2001 From: kdh8219 <65698239+kdh8219@users.noreply.github.com> Date: Fri, 5 May 2023 16:37:58 +0900 Subject: [PATCH] fix #6 --- src/functions.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/functions.ts b/src/functions.ts index 25a82dc..61e4ebd 100644 --- a/src/functions.ts +++ b/src/functions.ts @@ -13,15 +13,17 @@ export function dmSlice(raw: string): string[] { if (txt.length <= 2000) { return { front: txt, - end: "", + end: null, }; } let front = txt.slice(0, 2000); let end = txt.slice(2000, txt.length); if (end) { - let toLast = front.slice(front.lastIndexOf("\n"), -1); + let toLastNextLine = + "ㅤ" /* 공백문자 */ + + front.slice(front.lastIndexOf("\n"), front.length); front = front.slice(0, front.lastIndexOf("\n")); - end = toLast + end; + end = toLastNextLine + end; } return { front, end }; }