76778e70 by Jernej Fijačko Committed by jforbes

Trim whitespace & newlines in line data before feeding it to the parser

1 parent 4fd2994e
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
70 nextNewline = buffer.indexOf('\n'); 70 nextNewline = buffer.indexOf('\n');
71 71
72 for (; nextNewline > -1; nextNewline = buffer.indexOf('\n')) { 72 for (; nextNewline > -1; nextNewline = buffer.indexOf('\n')) {
73 this.trigger('data', buffer.substring(0, nextNewline)); 73 this.trigger('data', buffer.substring(0, nextNewline).replace(/^\s+|\s+$/g, ''));
74 buffer = buffer.substring(nextNewline + 1); 74 buffer = buffer.substring(nextNewline + 1);
75 } 75 }
76 }; 76 };
......