We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95eedee commit eb12cd7Copy full SHA for eb12cd7
lib/InputStream.js
@@ -24,7 +24,10 @@ InputStream.prototype = {
24
if(this.start >= this.data.length) {
25
return InputStream.EOF;
26
}
27
- return this.data[this.start++];
+ var ch = this.data[this.start++];
28
+ if (ch === '\r')
29
+ ch = '\n';
30
+ return ch;
31
},
32
advance: function(amount) {
33
this.start += amount;
@@ -61,7 +64,7 @@ InputStream.prototype = {
61
64
} else if(m = new RegExp(re + (this.eof ? "|$" : "")).exec(s)) {
62
65
var t = this.data.slice(this.start, this.start + m.index);
63
66
this.advance(m.index);
- return t.toString();
67
+ return t.replace(/\r/g, '\n').replace(/\n{2,}/g, '\n');
68
} else {
69
throw InputStream.DRAIN;
70
0 commit comments