Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
Moved whitespace removal into push()
Browse files Browse the repository at this point in the history
  • Loading branch information
jforbes committed May 27, 2015
1 parent d8c7331 commit 78ec5de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/m3u8/m3u8-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
nextNewline = buffer.indexOf('\n');

for (; nextNewline > -1; nextNewline = buffer.indexOf('\n')) {
this.trigger('data', buffer.substring(0, nextNewline).replace(/^\s+|\s+$/g, ''));
this.trigger('data', buffer.substring(0, nextNewline));
buffer = buffer.substring(nextNewline + 1);
}
};
Expand Down Expand Up @@ -108,6 +108,9 @@
*/
ParseStream.prototype.push = function(line) {
var match, event;

//strip whitespace
line = line.replace(/^\s+|\s+$/g, '');
if (line.length === 0) {
// ignore empty lines
return;
Expand Down

0 comments on commit 78ec5de

Please sign in to comment.