Prepare for conditionally escaping Markdown based on user settings.

Review Request #6467 — Created Oct. 20, 2014 and submitted

Information

Review Board
release-2.0.x
f0c6024...

Reviewers

Previously, we assumed that plain text should always be Markdown-escaped
for editing purposes. However, when Markdown becomes optional, we won't
always want to do this. Instead, we want to take the user's settings
into account, and only escape if the text isn't already in Markdown and
the user has chosen to edit in Markdown by default.

A couple of new Markdown utility functions were added to normalize text
for editing and for determining if a user wants to edit in Markdown by
default. The latter is hard-coded to True right now.

New template tags have been added for this new normalization. The old
markdown_escape filter has been removed. Templates now contain the
proper edit state for the user.

Unit tests pass.

Toggled the user default on and saw that all Markdown fields on review requests
and review replies were showing up as Markdown, and that plain text fields were
being escaped for edit.

Toggled it off and saw that both Markdown and plain text fields were represented
as-is, without any escaping.

Description From Last Updated

undefined name 'request'

reviewbotreviewbot

list comprehension redefines 'file_attachment' from line 578

reviewbotreviewbot

Can you flip this sentence around? This will normalize text for editing based on the rich_text flag and the user …

daviddavid

list comprehension redefines 'file_attachment' from line 578

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/fields.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/context.py
    
    Ignored Files:
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/templates/reviews/review_header.html
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/change.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/fields.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/context.py
    
    Ignored Files:
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/templates/reviews/review_header.html
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/change.html
    
    
  2. reviewboard/reviews/fields.py (Diff revision 1)
     
     
    Show all issues
     undefined name 'request'
    
  3. reviewboard/reviews/views.py (Diff revision 1)
     
     
    Show all issues
     list comprehension redefines 'file_attachment' from line 578
    
  4. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/fields.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/context.py
    
    Ignored Files:
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/templates/reviews/review_header.html
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/change.html
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/reviews/markdown_utils.py
        reviewboard/reviews/fields.py
        reviewboard/reviews/templatetags/reviewtags.py
        reviewboard/reviews/context.py
    
    Ignored Files:
        reviewboard/templates/reviews/boxes/review.html
        reviewboard/templates/reviews/review_header.html
        reviewboard/templates/reviews/reviewable_page_data.js
        reviewboard/templates/reviews/review_reply.html
        reviewboard/templates/reviews/boxes/change.html
    
    
  2. reviewboard/reviews/views.py (Diff revision 2)
     
     
    Show all issues
     list comprehension redefines 'file_attachment' from line 578
    
  3. 
      
david
  1. 
      
  2. reviewboard/reviews/markdown_utils.py (Diff revision 2)
     
     
     
    Show all issues

    Can you flip this sentence around?

    This will normalize text for editing based on the rich_text flag and the user settings.

  3. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to markdown-redesign (cc94cc7)