From cf2d265d255d6bb42e91452f2528b4a0b7080267 Mon Sep 17 00:00:00 2001 From: bashbunni Date: Mon, 7 Oct 2024 14:39:55 -0700 Subject: [PATCH] fix(render): strip carriage returns from strings --- style.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/style.go b/style.go index 2aba56b0..19a0f8f2 100644 --- a/style.go +++ b/style.go @@ -353,6 +353,8 @@ func (s Style) Render(strs ...string) string { // Potentially convert tabs to spaces str = s.maybeConvertTabs(str) + // carriage returns can cause strange behaviour when rendering. + str = strings.ReplaceAll(str, "\r", "") // Strip newlines in single line mode if inline {