Fix to handle extra #enddocregion tags

This commit is contained in:
Jay Traband 2015-08-11 19:12:19 -07:00
parent 4d2ac96fa2
commit 1859849fbb
1 changed files with 5 additions and 3 deletions

View File

@ -25,9 +25,11 @@ module.exports = function regionExtractor() {
lines[ix] = nullLine;
docs.push(doc);
} else if (hasEndRegionTag(line)) {
lines[ix] = nullLine;
doc.endIx = ix;
doc = docStack.pop();
if (doc) {
lines[ix] = nullLine;
doc.endIx = ix;
doc = docStack.pop();
}
}
}
});