Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken spans in diffs #14678

Merged
merged 1 commit into from
Feb 14, 2021
Merged

Commits on Feb 14, 2021

  1. Fix broken spans in diffs

    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 go-gitea#14231
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath committed Feb 14, 2021
    Configuration menu
    Copy the full SHA
    ae9dc35 View commit details
    Browse the repository at this point in the history