Repository: gohugoio/hugo (language: go)

Issue:
Hugo 0.139.0 minification breaks Google search results
Minification in Hugo 0.139.0 will convert

```html
<gcse:searchresults-only></gcse:searchresults-only>
```

into

```html
<gcse :searchresults-only></gcse:searchresults-only>
```

Notice the space in between the "gcse" and the colon. This prevents search results from being displayed.

---

### Hugo 0.138.0 is fine

Results are showing fine here, the last commit using Hugo 0.138.0:

- https://deploy-preview-5567--opentelemetry.netlify.app/search/?q=load shows search results
  ```console
  $ curl -s "https://deploy-preview-5567--opentelemetry.netlify.app/search/?q=load" | perl -ne 'print "$&\n" if /<gcse..*?>/g' 
  <gcse:searchresults-only>
  ```

### Hugo 0.139.0 adds space to GCSE tag name

With https://github.com/open-telemetry/opentelemetry.io/pull/5642, we upgraded to Hugo 0.139.0, and you can see the inserted space character in the tag name:

- https://deploy-preview-5642--opentelemetry.netlify.app/search/?q=load
  ```console
  $ curl -s "https://deploy-preview-5642--opentelemetry.netlify.app/search/?q=load" | perl -ne 'print "$&\n" if /<gcse..*?>/g' 
  <gcse :searchresults-only>
  ```

Related:

- https://github.com/open-telemetry/opentelemetry.io/issues/5673

/cc @svrnm @theletterf



Discussion / hints:

Fix patch:
diff --git a/go.mod b/go.mod
index 3013813ab02..03df8b3dbcd 100644
--- a/go.mod
+++ b/go.mod
@@ -67,8 +67,8 @@ require (
 	github.com/spf13/cobra v1.8.1
 	github.com/spf13/fsync v0.10.1
 	github.com/spf13/pflag v1.0.5
-	github.com/tdewolff/minify/v2 v2.21.1
-	github.com/tdewolff/parse/v2 v2.7.18
+	github.com/tdewolff/minify/v2 v2.20.37
+	github.com/tdewolff/parse/v2 v2.7.15
 	github.com/tetratelabs/wazero v1.8.1
 	github.com/yuin/goldmark v1.7.8
 	github.com/yuin/goldmark-emoji v1.0.4
diff --git a/go.sum b/go.sum
index 32005ff6f70..2920de0f8d0 100644
--- a/go.sum
+++ b/go.sum
@@ -447,10 +447,10 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
 github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
 github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
 github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/tdewolff/minify/v2 v2.21.1 h1:AAf5iltw6+KlUvjRNPAPrANIXl3XEJNBBzuZom5iCAM=
-github.com/tdewolff/minify/v2 v2.21.1/go.mod h1:PoqFH8ugcuTUvKqVM9vOqXw4msxvuhL/DTmV5ZXhSCI=
-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/minify/v2 v2.20.37 h1:Q97cx4STXCh1dlWDlNHZniE8BJ2EBL0+2b0n92BJQhw=
+github.com/tdewolff/minify/v2 v2.20.37/go.mod h1:L1VYef/jwKw6Wwyk5A+T0mBjjn3mMPgmjjA688RNsxU=
+github.com/tdewolff/parse/v2 v2.7.15 h1:hysDXtdGZIRF5UZXwpfn3ZWRbm+ru4l53/ajBRGpCTw=
+github.com/tdewolff/parse/v2 v2.7.15/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
 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=
 github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=


Test patch:
diff --git a/minifiers/minifiers_test.go b/minifiers/minifiers_test.go
index bfd743fae3a..b81c632fedd 100644
--- a/minifiers/minifiers_test.go
+++ b/minifiers/minifiers_test.go
@@ -153,10 +153,12 @@ func TestBugs(t *testing.T) {
 		rawString         string
 		expectedMinString string
 	}{
-		// https://github.com/gohugoio/hugo/issues/5506
+		// Issue 5506
 		{media.Builtin.CSSType, " body { color: rgba(000, 000, 000, 0.7); }", "body{color:rgba(0,0,0,.7)}"},
-		// https://github.com/gohugoio/hugo/issues/8332
+		// Issue 8332
 		{media.Builtin.HTMLType, "<i class='fas fa-tags fa-fw'></i> Tags", `<i class='fas fa-tags fa-fw'></i> Tags`},
+		// Issue #13082
+		{media.Builtin.HTMLType, "<gcse:searchresults-only></gcse:searchresults-only>", `<gcse:searchresults-only></gcse:searchresults-only>`},
 	} {
 		var b bytes.Buffer