Skip to content

Commit d06dcc2

Browse files
authored
Fix to address pugjs#3263 for "in" usage
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".
1 parent d4b7f60 commit d06dcc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/pug-lexer/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ Lexer.prototype = {
10871087

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

0 commit comments

Comments
 (0)