Refactor code render and render control chars (#37078)

Fix #37057
This commit is contained in:
wxiaoguang
2026-04-03 12:10:01 +08:00
committed by GitHub
parent 7b17234945
commit 6eed75af24
8 changed files with 173 additions and 97 deletions

View File

@@ -1140,7 +1140,7 @@ func TestHighlightCodeLines(t *testing.T) {
ret := highlightCodeLinesForDiffFile(diffFile, true, []byte("a\nb\n"))
assert.Equal(t, map[int]template.HTML{
0: `<span class="n">a</span>` + nl,
1: `<span class="n">b</span>`,
1: `<span class="n">b</span>` + nl,
}, ret)
})
}