Skip to content

Commit 5f95acf

Browse files
committed
CSS: fix bug with custom variables starting with a digit, fixes #861; HTML: fix bug in lowercasing template attributes
1 parent d106cf6 commit 5f95acf

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

‎css/css_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ func TestCSSInline(t *testing.T) {
348348
{"--foo: ;", "--foo: "}, // whitespace value
349349
{"--foo:;", "--foo:"}, // empty value
350350
{"--foo: initial ;", "--foo:initial"}, // invalid value, serializes to empty
351+
{"x: var(--0);", "x:var(--0)"},
351352
{"color=blue;", "color=blue"},
352353
{"x: white , white", "x:white,white"},
353354

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/djherbis/atime v1.1.0
99
github.com/fsnotify/fsnotify v1.8.0
1010
github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb
11-
github.com/tdewolff/parse/v2 v2.8.3
11+
github.com/tdewolff/parse/v2 v2.8.4
1212
github.com/tdewolff/test v1.0.11
1313
)
1414

‎go.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb h1:Id2aj2q74MC+yHBGQ
2323
github.com/tdewolff/argp v0.0.0-20250209172303-079abae893fb/go.mod h1:PKhwRVvnrI2gye5NRF3c4VWbE+3E9mGyRUsNWGcJlDY=
2424
github.com/tdewolff/parse/v2 v2.8.3 h1:5VbvtJ83cfb289A1HzRA9sf02iT8YyUwN84ezjkdY1I=
2525
github.com/tdewolff/parse/v2 v2.8.3/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
26+
github.com/tdewolff/parse/v2 v2.8.4 h1:A6slgBLGGDPBMGA28KQZfHpaKffuNvhOe7zSag+x/rw=
27+
github.com/tdewolff/parse/v2 v2.8.4/go.mod h1:Hwlni2tiVNKyzR1o6nUs4FOF07URA+JLBLd6dlIXYqo=
2628
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
2729
github.com/tdewolff/test v1.0.11 h1:FdLbwQVHxqG16SlkGveC0JVyrJN62COWTRyUFzfbtBE=
2830
github.com/tdewolff/test v1.0.11/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=

‎html/html_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ func TestHTMLGoTemplates(t *testing.T) {
382382
{`<p>Hello <code>{{""}}</code> there</p>`, `<p>Hello <code>{{""}}</code> there`},
383383
{`<select><option>Default</option>{{range $i, $lang := .Languages}}<option>{{$lang}}</option>{{end}}</select>`, `<select><option>Default{{range $i, $lang := .Languages}}<option>{{$lang}}{{end}}</select>`},
384384
{`<tr{{if .Deleted}} class="is-disabled"{{end}}>`, `<tr{{if .Deleted}} class="is-disabled"{{end}}>`},
385+
{`<a {{.Foo}}{{xx .Bar}}>`, `<a {{.Foo}}{{xx .Bar}}>`},
385386

386387
// whitespace
387388
{`{{ printf " ! " }}`, `{{ printf " ! " }}`},

0 commit comments

Comments
 (0)