Skip to content

Commit

Permalink
fix(render): strip carriage returns from strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Oct 7, 2024
1 parent b08e7e4 commit cf2d265
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cf2d265

Please sign in to comment.