From 341b0c88f6015f7cf15390095bbbe024d3e73adb Mon Sep 17 00:00:00 2001 From: thekevinhunt <71470205+thekevinhunt@users.noreply.github.com> Date: Wed, 3 Mar 2021 16:26:01 -0600 Subject: [PATCH] Fix to address #3263 for "in" usage I was still hitting issue #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". --- packages/pug-lexer/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pug-lexer/index.js b/packages/pug-lexer/index.js index 51836c08e..dacedafd6 100644 --- a/packages/pug-lexer/index.js +++ b/packages/pug-lexer/index.js @@ -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];