Handle CR when skipping newlines.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user