mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
tpl/transform: Optional options for highlight func
Closes #9249 Fixes gohugoio/hugoDocs#63
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
b4f27ef8e7
commit
5538507e90
@@ -26,7 +26,6 @@ import (
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/langs"
|
||||
|
||||
)
|
||||
|
||||
type tstNoStringer struct{}
|
||||
@@ -71,10 +70,11 @@ func TestHighlight(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
s interface{}
|
||||
lang string
|
||||
opts string
|
||||
opts interface{}
|
||||
expect interface{}
|
||||
}{
|
||||
{"func boo() {}", "go", "", "boo"},
|
||||
{"func boo() {}", "go", nil, "boo"},
|
||||
// Issue #4179
|
||||
{`<Foo attr=" < "></Foo>`, "xml", "", `&lt;`},
|
||||
{tstNoStringer{}, "go", "", false},
|
||||
|
Reference in New Issue
Block a user