Repository: gohugoio/hugo (language: go)

Issue:
hugo/parser: String shortcode parameter typed boolean false
This has been present since boolean params were first allowed in v0.59.0 ([#6376](https://github.com/gohugoio/hugo/pull/6376)).

markdown

```text
{{< foo b=xfalse >}} 
```

layouts/shortcodes/foo.html


```text
{{ printf "%[1]v (%[1]T)" (.Get "b") }} --> false (bool)
```

This requires a trivial regex change.



Discussion / hints:

Fix patch:
diff --git a/parser/pageparser/item.go b/parser/pageparser/item.go
index 2083be70a94..d4dcc2785e9 100644
--- a/parser/pageparser/item.go
+++ b/parser/pageparser/item.go
@@ -215,7 +215,7 @@ const (
 )
 
 var (
-	boolRe  = regexp.MustCompile(`^(true$)|(false$)`)
+	boolRe  = regexp.MustCompile(`^(true|false)$`)
 	intRe   = regexp.MustCompile(`^[-+]?\d+$`)
 	floatRe = regexp.MustCompile(`^[-+]?\d*\.\d+$`)
 )


Test patch:
diff --git a/parser/pageparser/item_test.go b/parser/pageparser/item_test.go
index db4cc127a82..72bb69103b9 100644
--- a/parser/pageparser/item_test.go
+++ b/parser/pageparser/item_test.go
@@ -38,6 +38,13 @@ func TestItemValTyped(t *testing.T) {
 	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, true)
 	source = []byte("false")
 	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, false)
-	source = []byte("trued")
+	source = []byte("falsex")
+	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "falsex")
+	source = []byte("xfalse")
+	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "xfalse")
+	source = []byte("truex")
+	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "truex")
+	source = []byte("xtrue")
+	c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "xtrue")
 
 }