Skip to content

Commit

Permalink
fix: remove newlines when truncating text
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 4, 2024
1 parent 29103b9 commit f42e550
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f42e550

Please sign in to comment.