diff --git a/src/Parser.spec.ts b/src/Parser.spec.ts index 02e12b15c..b420b005e 100644 --- a/src/Parser.spec.ts +++ b/src/Parser.spec.ts @@ -89,10 +89,20 @@ describe("API", () => { expect(p.startIndex).toBe(0); expect(p.endIndex).toBe(2); - p.write(""); + p.write(""); + + expect(p.startIndex).toBe(11); + expect(p.endIndex).toBe(18); + + p.parseChunk(""); + + expect(p.startIndex).toBe(19); + expect(p.endIndex).toBe(27); }); test("should not have the start index be greater than the end index", () => { diff --git a/src/Parser.ts b/src/Parser.ts index 73f9c2f8d..aae4cc17e 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -286,7 +286,7 @@ export class Parser { } onclosetag(name: string): void { - this.updatePosition(1); + this.updatePosition(2); if (this.lowerCaseTagNames) { name = name.toLowerCase(); }