• 
      

    Fix a regression in displaying diff fragments in comments.

    Review Request #12402 — Created June 22, 2022 and submitted

    Information

    Review Board
    release-5.0.x

    Reviewers

    When upgrading to Django 3.2, we converted all of our template tags and
    filters to use mark_safe() instead of setting is_safe = True, with
    the exception of showextrawhitespace.

    This was turning safe HTML into an unsafe string, and the result was
    that any comments shown in comments in a review or in e-mails was
    turning into big blobs of escaped HTML.

    This change fixes it to use mark_safe(), and adds some unit tests to
    ensure this never regresses.

    Viewed comments in a diff that exhibited this problem. Saw that the
    content was correct in all chunks of the diffs I expanded.

    Unit tests pass.

    Summary ID
    Fix a regression in displaying diff fragments in comments.
    When upgrading to Django 3.2, we converted all of our template tags and filters to use `mark_safe()` instead of setting `is_safe = True`, with the exception of `showextrawhitespace`. This was turning safe HTML into an unsafe string, and the result was that any comments shown in comments in a review or in e-mails was turning into big blobs of escaped HTML. This change fixes it to use `mark_safe()`, and adds some unit tests to ensure this never regresses.
    a7fa233481bd87007ed7ea4fa094fe33570c5a51
    david
    1. Ship It!
    2. 
        
    maubin
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-5.0.x (7d3605f)