aboutsummaryrefslogtreecommitdiff
path: root/formatter/formatter_test.go
diff options
context:
space:
mode:
authorjturtle <jturtl@pm.me> 2023-09-30 22:13:14 +0000
committerThomas Voss <mail@thomasvoss.com> 2023-10-02 00:14:21 +0200
commit56f9526181c725edc0a1ede50fc86443d080c7a5 (patch)
tree4a454492d8b0e31474bb67c3a191403f5cdd49d5 /formatter/formatter_test.go
parent1da33201a9a022673bad5fbff2d4636049240808 (diff)
Fix class/attribute mixup bug
There's a bug in the current version of GSP where an element like this: p .class attribute="value" {-} would be transpiled as this: <p class="value" attribute="value"></p> The `classes` slice in `func printAttrs` (`formatter.go`, line 50) was the cause. I fixed it by making a deep copy of the `attrs` slice. I'm not a Go programmer, there might be a nicer way to make a deep copy of a slice. But it does, indeed, work. P.S. thanks for making this, writing HTML by hand is now slightly less painful!
Diffstat (limited to 'formatter/formatter_test.go')
0 files changed, 0 insertions, 0 deletions