Add a session default for rich text, and reflect it in TextEditorView.

Review Request #6476 — Created Oct. 21, 2014 and submitted

Information

Review Board
release-2.0.x
574a4f5...

Reviewers

UserSession now has a 'defaultUseRichText' flag (currently hard-coded to
true) that indicates if text fields should always default to Markdown
when saving.

If set, TextEditorView will force any text field to be in Markdown mode
initially when open, even if the richText attribute passed to it is
false. This is to keep with the current behavior where plain text fields
(such as those filled in by rbt post) are set to save as Markdown for
any modifications.

(Of course, that only works if the plain text coming in is escaped for
Markdown, which is the responsibility of the caller. A comment above
this new code explains that assumption.)

If the default for the user is not to use Markdown, then the text field
will reflect the provided richText setting.

Unit tests pass.

Tested manually with different combinations of incoming richText values
and different user defaults.

reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/ui/views/tests/textEditorViewTests.js
        reviewboard/static/rb/js/ui/views/textEditorView.js
        reviewboard/templates/base.html
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/ui/views/tests/textEditorViewTests.js
        reviewboard/static/rb/js/ui/views/textEditorView.js
        reviewboard/templates/base.html
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to markdown-redesign (5627cbb)