Skip to content

Commit

Permalink
fix: actually fix bad ref with bad xml feed
Browse files Browse the repository at this point in the history
fixes #14
  • Loading branch information
fent committed Jan 24, 2018
1 parent 4656ccc commit 8034403
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/xmlfeedparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function trimIndent(str) {
// The last line should be indented and only contain whitespace.
if (split.length > 1 &&
(rs = /^((?: {3})+|(?: {2})+|(?: {4})+|(?:\t)+)$/m.exec(
split[split.length - 1]))) {
split[split.length - 1]))) {

// The very first line should be empty.
if (split.shift() !== '') {
Expand Down Expand Up @@ -103,8 +103,9 @@ module.exports = (buffer) => {
obj.type = type;
this.emit('type', type);
} else {
parser.removeListener('opentag', openf1);
parser.emit('error', new Error('Feed type not recognized'));
parser.close();
parser.closed = true;
}
};
parser.on('opentag', openf1);
Expand Down

0 comments on commit 8034403

Please sign in to comment.