gerrit 2.1.2-rc3
Handle bare CR in the middle of a line

Prettify converts a bare CR in the middle of a line of text into a
<br/>, which we later convert back into an LF.  This skews all of the
line numbers through the rest of the file, resulting in a confusing
situation (due to the unexpected LF) as we try to map the formatted
HTML back into the SparseFileContent object we use for rendering.

Highlight bare CRs as spaces with whitespace error spans around them,
before we feed the text into prettify.  This ensures we won't get
back more lines than we fed in, so our formatting is still correct.

Change-Id: Ib2dc8b024a2211601a588fd0552c4963d5b6e028
Signed-off-by: Shawn O. Pearce <sop@google.com>
3 files changed