Skip to content

Commit

Permalink
Stricter regex for containerless statement end tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Munawwar committed Apr 26, 2014
1 parent f782a87 commit dadcb3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Htmlizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
stmt = match[1].replace('ifnot', 'if') + ': !(' + match[2] + ')';
}
//Convert /ifnot to /if
if ((match = stmt.match(/^\/(ifnot)/))) {
if ((match = stmt.match(/^\/(ifnot)$/))) {
stmt = '/if';
}

Expand Down Expand Up @@ -302,9 +302,9 @@
} else {
blockNestingCount += 1;
}
} else if ((match = stmt.match(/^\/(ko|if|foreach)/))) {
} else if ((match = stmt.match(/^\/(ko|if|foreach)$/))) {
//TODO: Check for unbalanced ifs/fors
if ((/^\/(ko|foreach)/).test(stmt) && stack[0] &&
if ((/^\/(ko|foreach)$/).test(stmt) && stack[0] &&
stack[0].key === 'foreach' && blockNestingCount === 0) {
foreachOpen = false;

Expand Down

0 comments on commit dadcb3f

Please sign in to comment.