From 3ce00d7bd6798555f6cb32328fd84c64e4cb6f25 Mon Sep 17 00:00:00 2001 From: Taco de Wolff Date: Thu, 24 Oct 2024 15:26:23 -0300 Subject: [PATCH] HTML: fix whitespace collapsing after invalid character reference, fixes #743 --- go.mod | 2 +- go.sum | 4 ++-- html/html_test.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8aa3d0bdc..4ffb5a897 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/fsnotify/fsnotify v1.7.0 github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 github.com/tdewolff/argp v0.0.0-20240625173203-87b04d5d3e52 - github.com/tdewolff/parse/v2 v2.7.18 + github.com/tdewolff/parse/v2 v2.7.19 github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 ) diff --git a/go.sum b/go.sum index a87d269ee..9f4459cf9 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/tdewolff/argp v0.0.0-20240625173203-87b04d5d3e52 h1:bHOA+qzNf3CwchHAIA1k68QgERWiOgZMIh3qoOB3DzA= github.com/tdewolff/argp v0.0.0-20240625173203-87b04d5d3e52/go.mod h1:e1dkYfBKpwfFhwXWrQpEU2ClFgxYOT4SrHd6fKD7nIE= -github.com/tdewolff/parse/v2 v2.7.18 h1:uSqjEMT2lwCj5oifBHDcWU2kN1pbLrRENgFWDJa57eI= -github.com/tdewolff/parse/v2 v2.7.18/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= +github.com/tdewolff/parse/v2 v2.7.19 h1:7Ljh26yj+gdLFEq/7q9LT4SYyKtwQX4ocNrj45UCePg= +github.com/tdewolff/parse/v2 v2.7.19/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA= github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE= github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 h1:IkjBCtQOOjIn03u/dMQK9g+Iw9ewps4mCl1nB8Sscbo= diff --git a/html/html_test.go b/html/html_test.go index 6a1fbad0c..2b450251a 100644 --- a/html/html_test.go +++ b/html/html_test.go @@ -115,6 +115,7 @@ func TestHTML(t *testing.T) { {``, ``}, {`a b c`, `a b c`}, {`a `, `a `}, + {"
\n Lorem & ipsum\n dolor sid amet\n
", "
Lorem & ipsum\ndolor sid amet
"}, // from HTML Minifier {`
boo
`, `
boo
`},