Skip to content

Commit

Permalink
Fix to address pugjs#3263 for "in" usage
Browse files Browse the repository at this point in the history
I was still hitting issue pugjs#3263 when using "in" instead of "of" (which caused other odd problems).  The regex was looking for * (0+) spaces instead of + (at least one) space.  Using + instead prevents the regex from catching "in ofxxxxx".
  • Loading branch information
thekevinhunt authored Mar 3, 2021
1 parent d4b7f60 commit d06dcc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pug-lexer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ Lexer.prototype = {

eachOf: function() {
var captures;
if ((captures = /^(?:each|for) (.*?) of *([^\n]+)/.exec(this.input))) {
if ((captures = /^(?:each|for) (.*?) of +([^\n]+)/.exec(this.input))) {
this.consume(captures[0].length);
var tok = this.tok('eachOf', captures[1]);
tok.value = captures[1];
Expand Down

0 comments on commit d06dcc2

Please sign in to comment.