Fix rendering diffs of changed text fields containing entities.

Review Request #8525 — Created Nov. 7, 2016 and submitted

Information

Review Board
release-2.5.x
548253c...

Reviewers

Text fields in the Review Request Changed boxes nicely show diffs to
help show what's changed. However, if these contain characters (such as
double quotes) that need to be turned into entities (such as "),
the region highlighting code will be thrown off, as it expects to be
highlighting regions of plain text code. We do strip the tags, but we
didn't unescape the entities.

This change updates the code to first unescape the entities and then
scan for the regions. This gives us regions that we can safely pass to
the highlighter (which itself can already deal with entities).

Added a unit test that exhibited the same behavior found in production.
Verified it was fixed after decoding entities.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests/test_fields.py
        reviewboard/reviews/fields.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests/test_fields.py
        reviewboard/reviews/fields.py
    
    
  2. 
      
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (618e3cf)
Loading...