Skip to content

Commit

Permalink
fix: closing tag positions
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Oct 12, 2021
1 parent ace5e36 commit 11b0fa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/core/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion src/states/OPEN_TAG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},

Expand Down

0 comments on commit 11b0fa8

Please sign in to comment.