gitea/services
zeripath ad6084a222
Fix broken spans in diffs (#14678) (#14683)
Backport #14678

Gitea runs diff on highlighted code fragment for each line in order to
provide code highlight diffs. Unfortunately this diff algorithm is not
aware that span tags and entities are atomic and cannot be split.

The current fixup code makes some attempt to fix these broken tags
however, it cannot handle situations where a tag is split over multiple
blocks.

This PR provides a more algorithmic fixup mechanism whereby spans and
entities are completely coalesced into their respective blocks.

This may result in a incompletely reduced diff but - it will definitely
prevent the broken entities and spans that are currently possible.

As a result of this fixup several inconsistencies were discovered in our
testcases and these were also fixed.

Fix #14231

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
2021-02-15 00:30:07 +01:00
..
comments Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221) 2021-01-03 15:44:40 +02:00
externalaccount Allow externalID to be UUID (#8551) 2019-10-17 10:06:28 +08:00
gitdiff Fix broken spans in diffs (#14678) (#14683) 2021-02-15 00:30:07 +01:00
issue Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221) 2021-01-03 15:44:40 +02:00
mailer fix mailIssueCommentBatch for pull request (#14252) (#14296) 2021-01-11 08:46:19 +08:00
mirror Fix branch/tag notifications in mirror sync (#13855) (#13862) 2020-12-05 23:30:28 -05:00
pull Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221) 2021-01-03 15:44:40 +02:00
release Send webhook when tag is removed via Web UI (#14015) (#14019) 2020-12-16 18:24:02 +01:00
repository Move update-server-info to hooks (#12826) 2020-10-14 00:24:06 +08:00
wiki Enforce setting HEAD in wiki to master (#13950) (#13961) 2020-12-12 17:21:26 +00:00