tpl/transform: Fix it when template.HTML is passes as option to Hightlight

Fixes #9591
This commit is contained in:
Bjørn Erik Pedersen
2022-03-02 10:44:29 +01:00
parent 9b8b6d34e2
commit 0327da050f
2 changed files with 9 additions and 3 deletions

View File

@@ -122,10 +122,13 @@ func applyOptions(opts interface{}, cfg *Config) error {
switch vv := opts.(type) {
case map[string]interface{}:
return applyOptionsFromMap(vv, cfg)
case string:
return applyOptionsFromString(vv, cfg)
default:
s, err := cast.ToStringE(opts)
if err != nil {
return err
}
return applyOptionsFromString(s, cfg)
}
return nil
}
func applyOptionsFromString(opts string, cfg *Config) error {