aboutsummaryrefslogtreecommitdiffstats
path: root/services/gitdiff/gitdiff.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2020-08-11 00:29:25 -0400
committerGitHub <noreply@github.com>2020-08-11 00:29:25 -0400
commit73b155d5f21813abc788a54aee0ee72459e7c7c9 (patch)
treed3b1dce6b8699dd3bebec6bc797e3008ffe23d2d /services/gitdiff/gitdiff.go
parenta4ba1ad5ed6415ffecd2a6d1234741b4c2532e35 (diff)
downloadgitea-73b155d5f21813abc788a54aee0ee72459e7c7c9.tar.gz
gitea-73b155d5f21813abc788a54aee0ee72459e7c7c9.zip
Add more tests for diff highlighting (#12467)
Adding some more tests for different cases to make sure they keep working Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'services/gitdiff/gitdiff.go')
-rw-r--r--services/gitdiff/gitdiff.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go
index fca210bb10..d50ae6ae27 100644
--- a/services/gitdiff/gitdiff.go
+++ b/services/gitdiff/gitdiff.go
@@ -181,7 +181,7 @@ var (
removedCodePrefix = []byte(`<span class="removed-code">`)
codeTagSuffix = []byte(`</span>`)
)
-var addSpanRegex = regexp.MustCompile(`<span class="[a-z]*$`)
+var addSpanRegex = regexp.MustCompile(`<span [class="[a-z]*]*$`)
func diffToHTML(fileName string, diffs []diffmatchpatch.Diff, lineType DiffLineType) template.HTML {
buf := bytes.NewBuffer(nil)