Skip to content

Commit fe4220f

Browse files
committed
fix: capture groups for each statements
improve capture group regex for `each` statements using a greedy match. fixes pugjs#3263
1 parent 06baa52 commit fe4220f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/pug-lexer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ Lexer.prototype = {
10821082

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

0 commit comments

Comments
 (0)