diff --git a/src/core/Parser.ts b/src/core/Parser.ts index c3431f3c..4c85b991 100644 --- a/src/core/Parser.ts +++ b/src/core/Parser.ts @@ -252,8 +252,8 @@ export class Parser extends BaseParser { // var this.notifiers.notifyScriptlet = notifiers.notifyScriptlet; notifyError(pos, errorCode, message) { - this.end(); this.notifiers.notifyError(pos, errorCode, message); + this.end(); } closeTag(tagName: string, pos?: number, endPos?: number) { @@ -464,18 +464,18 @@ export class Parser extends BaseParser { this.lookAheadFor("/" + this.expectedCloseTagName + ">"); if (match) { + const startPos = this.pos; if (this.state === STATE.JS_COMMENT_LINE) { this.exitState(); this.forward = true; } this.endText(); - + this.skip(match.length); this.closeTag( this.expectedCloseTagName, - this.pos, - this.pos + 1 + match.length + startPos, + this.pos + 1 ); - this.skip(match.length); this.enterState(STATE.HTML_CONTENT); return true; } diff --git a/src/states/OPEN_TAG.ts b/src/states/OPEN_TAG.ts index eb984298..60f3842f 100644 --- a/src/states/OPEN_TAG.ts +++ b/src/states/OPEN_TAG.ts @@ -246,7 +246,8 @@ export const OPEN_TAG = Parser.createState({ eol(linebreak) { if (this.isConcise && !this.currentOpenTag.withinAttrGroup) { // In concise mode we always end the open tag - this.exitState(linebreak); + this.exitState(); + this.skip(linebreak.length) } },