Skip to content

Commit

Permalink
fix: collapse whitespace in Go string expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h committed Jan 29, 2024
1 parent 3de67f6 commit a85281c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parser/v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,9 @@ func (se StringExpression) Trailing() TrailingSpace {
func (se StringExpression) IsNode() bool { return true }
func (se StringExpression) IsStyleDeclarationValue() bool { return true }
func (se StringExpression) Write(w io.Writer, indent int) error {
if isWhitespace(se.Expression.Value) {
se.Expression.Value = ""
}
return writeIndent(w, indent, `{ `, se.Expression.Value, ` }`)
}

Expand Down

0 comments on commit a85281c

Please sign in to comment.