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>
This commit is contained in:
mrsdizzie 2020-08-11 00:29:25 -04:00 committed by GitHub
parent a4ba1ad5ed
commit 73b155d5f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -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)