summaryrefslogtreecommitdiffstats
path: root/services/gitdiff/gitdiff.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-12-17 22:38:54 +0800
committerGitHub <noreply@github.com>2023-12-17 14:38:54 +0000
commit20929edc9962281e35a81756d76dd1caa5741ff8 (patch)
tree138bbb9c97e609136fe83cf6e5524949218d1e72 /services/gitdiff/gitdiff.go
parent408a4842240e7dd906e682196bd4254d6c76fcb9 (diff)
downloadgitea-20929edc9962281e35a81756d76dd1caa5741ff8.tar.gz
gitea-20929edc9962281e35a81756d76dd1caa5741ff8.zip
Add option to disable ambiguous unicode characters detection (#28454)
* Close #24483 * Close #28123 * Close #23682 * Close #23149 (maybe more)
Diffstat (limited to 'services/gitdiff/gitdiff.go')
-rw-r--r--services/gitdiff/gitdiff.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go
index 75fc687c86..0f6e2b6c17 100644
--- a/services/gitdiff/gitdiff.go
+++ b/services/gitdiff/gitdiff.go
@@ -285,15 +285,15 @@ type DiffInline struct {
// DiffInlineWithUnicodeEscape makes a DiffInline with hidden unicode characters escaped
func DiffInlineWithUnicodeEscape(s template.HTML, locale translation.Locale) DiffInline {
- status, content := charset.EscapeControlHTML(string(s), locale)
- return DiffInline{EscapeStatus: status, Content: template.HTML(content)}
+ status, content := charset.EscapeControlHTML(s, locale)
+ return DiffInline{EscapeStatus: status, Content: content}
}
// DiffInlineWithHighlightCode makes a DiffInline with code highlight and hidden unicode characters escaped
func DiffInlineWithHighlightCode(fileName, language, code string, locale translation.Locale) DiffInline {
highlighted, _ := highlight.Code(fileName, language, code)
status, content := charset.EscapeControlHTML(highlighted, locale)
- return DiffInline{EscapeStatus: status, Content: template.HTML(content)}
+ return DiffInline{EscapeStatus: status, Content: content}
}
// GetComputedInlineDiffFor computes inline diff for the given line.