Closed as not planned
Description
Follows
Background
Gitea's code diff is based on highlighted code at the moment. #19958 only does some improvements, there are still some bad cases for rendering if the diff breaks in a highlighted span. See the screenshot, the diff result is inconsistent.
(more hints, in the second screenshot, the color of bbbb
is different, it's also caused by that the diff breaks in the span)
Possible solutions
Use "semantic change expanding" algorithm
Expand the spans with semantics to other diff sections?
Use a general token parser
More aggressively, use placeholders for all tokens (make aaaabbbb
a token), then there will be no break in tokens?
Some other diff algorithms
(TODO)
Some references
- https://github.com/dandavison/delta
- Git's
[diff].algorithm = patience
Metadata
Metadata
Assignees
Labels
No labels