mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 01:32:45 +00:00
parent
72903be587
commit
c067f34558
2 changed files with 4 additions and 2 deletions
|
@ -55,7 +55,7 @@ func (ns *Namespace) Highlight(s interface{}, lang, opts string) (template.HTML,
|
|||
return "", err
|
||||
}
|
||||
|
||||
highlighted, _ := ns.deps.ContentSpec.Highlight(html.UnescapeString(ss), lang, opts)
|
||||
highlighted, _ := ns.deps.ContentSpec.Highlight(ss, lang, opts)
|
||||
return template.HTML(highlighted), nil
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,8 @@ func TestHighlight(t *testing.T) {
|
|||
expect interface{}
|
||||
}{
|
||||
{"func boo() {}", "go", "", "boo"},
|
||||
// Issue #4179
|
||||
{`<Foo attr=" < "></Foo>`, "xml", "", `&lt;`},
|
||||
{tstNoStringer{}, "go", "", false},
|
||||
} {
|
||||
errMsg := fmt.Sprintf("[%d]", i)
|
||||
|
@ -81,7 +83,7 @@ func TestHighlight(t *testing.T) {
|
|||
}
|
||||
|
||||
require.NoError(t, err, errMsg)
|
||||
assert.Contains(t, result, "boo", errMsg)
|
||||
assert.Contains(t, result, test.expect.(string), errMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue