-
-
Notifications
You must be signed in to change notification settings - Fork 226
Closed
Description
package main
import (
"fmt"
"github.com/tdewolff/minify/v2"
"github.com/tdewolff/minify/v2/html"
)
func main() {
data := `<select>
{{ range . }}
<option>{{ . }}
{{ end }}
</select>`
fmt.Println(data)
fmt.Println("---")
m := minify.New()
m.Add("text/html", &html.Minifier{TemplateDelims: html.GoTemplateDelims})
var err error
if data, err = m.String("text/html", data); err != nil {
panic(err)
}
fmt.Println(data)
}
https://go.dev/play/p/YkV7UfwvmIk
<select>
{{ range . }}
<option>{{ . }}
{{ end }}
</select>
<select><option>{{ . }}
{{ end }}
</select>
Not all range operators in my templates were eaten but something about the way this one is written really confuses minify, I've tried to golf it down a bit.
Metadata
Metadata
Assignees
Labels
No labels