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
Add a session default for rich text, and reflect it in TextEditorView.
Review Request #6476 — Created Oct. 21, 2014 and submitted
UserSession now has a 'defaultUseRichText' flag (currently hard-coded to
true) that indicates if text fields should always default to Markdown
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
(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.