tpl/transform: Do not unescape input to highlight

Fixes #4179
This commit is contained in:
Bjørn Erik Pedersen
2017-12-29 09:52:43 +01:00
parent 72903be587
commit c067f34558
2 changed files with 4 additions and 2 deletions

View File

@@ -69,6 +69,8 @@ func TestHighlight(t *testing.T) {
expect interface{}
}{
{"func boo() {}", "go", "", "boo"},
// Issue #4179
{`<Foo attr=" &lt; "></Foo>`, "xml", "", `&amp;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)
}
}