0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-26 06:14:19 +01:00
gitea/services
zeripath beb2058186
Fix broken spans in diffs (#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>
2021-02-14 15:51:00 +01:00
..
archiver migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
comments Enhance Ghost comment mitigation Settings (#14392) 2021-01-21 21:56:19 -05:00
externalaccount Allow externalID to be UUID (#8551) 2019-10-17 10:06:28 +08:00
gitdiff Fix broken spans in diffs (#14678) 2021-02-14 15:51:00 +01:00
issue label and milestone webhooks on issue/pull creation (#14363) 2021-01-17 16:15:57 +02:00
mailer Add dismiss review feature (#12674) 2021-02-11 18:32:25 +01:00
mirror [API] Add pagination to ListBranches (#14524) 2021-02-03 20:06:13 +01:00
pull Add dismiss review feature (#12674) 2021-02-11 18:32:25 +01:00
release Fix wrong publisher id (#14212) 2021-01-01 16:03:31 -05:00
repository migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00
webhook Added option to disable webhooks (#13176) 2021-02-11 12:34:34 -05:00
wiki migrate from com.* to alternatives (#14103) 2020-12-25 11:59:32 +02:00