From f42e550e3c4b22e95c3278af41a055c946727f07 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Fri, 4 Oct 2024 10:59:25 -0600 Subject: [PATCH] fix: remove newlines when truncating text --- src/table.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/table.tsx b/src/table.tsx index 2988c93..11381e5 100644 --- a/src/table.tsx +++ b/src/table.tsx @@ -178,7 +178,9 @@ function formatTextWithMargins({ } } - const text = cliTruncate(valueWithNoZeroWidthChars, spaceForText, {position: determineTruncatePosition(overflow)}) + const text = cliTruncate(valueWithNoZeroWidthChars.replaceAll('\n', ' '), spaceForText, { + position: determineTruncatePosition(overflow), + }) const spaces = width - stripAnsi(text).length return { text,