Prepare for conditionally escaping Markdown based on user settings.

Review Request #6467 — Created Oct. 19, 2014 and submitted — Latest diff uploaded

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.

    Loading...