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.
Signed-off-by: Shawn O. Pearce <email@example.com>
3 files changed