• 
      

    Support handling fine-grained rich text values in the UI.

    Review Request #6462 — Created Oct. 18, 2014 and submitted — Latest diff uploaded

    Information

    Review Board
    release-2.0.x
    34cfb32...

    Reviewers

    Now that the models and API support fine-grained rich text values,
    the UI needs to be updated to handle those.

    With this change, any plain-text fields will be auto-escaped for editing
    in Markdown, and will then be saved as Markdown when the user saves the
    field. This is the same behavior as before, but operates per-field,
    instead of assuming all fields have the same rich text value.

    As part of this, the rich text states are now kept solely in the models.
    There is no longer a data-rich-text= attribute.

    There are some backwards-incompatible changes for extension writers.
    Custom fields registered in JavaScript must now use the allowMarkdown
    setting instead of editMarkdown. They are also expected to take a
    fourth option (called fieldOptions) in formatter, which must be
    passed as an option to formatText.

    This change does not yet provide compatibility for custom fields. That
    will be covered in another change.

    Tested editing every single editable field for all objects.

    Tested with that field being in an initial state (new review requests,
    new comments, new replies, etc.). Saved and saw that the rich_text field
    was set.

    Tested with that field having rich_text=true. Saw that no escaping occurred.
    Saved and saw that the rich_text field was set to true. Reloaded and saw that
    the text was rendered as Markdown.

    Tested with that field having rich_text=false. Saw that escaping occurred.
    Saved and saw that the rich_text field was set to true. Reloaded and saw that
    the text was rendered as Markdown.

    Unit tests pass.