Handle CR when skipping newlines.

This commit is contained in:
Michael Bayne
2013-04-02 12:10:59 -07:00
parent 2889ee8692
commit c268d41594
@@ -286,6 +286,9 @@ public class Mustache
line++; line++;
// skip this newline character if we're configured to do so; TODO: handle CR // skip this newline character if we're configured to do so; TODO: handle CR
if (skipNewline) { if (skipNewline) {
// if the preceding character is '\r', strip that off too
int lastIdx = text.length()-1;
if (lastIdx >= 0 && text.charAt(lastIdx) == '\r') text.setLength(lastIdx);
skipNewline = false; skipNewline = false;
continue; continue;
} }