We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ea1944 commit baca2adCopy full SHA for baca2ad
src/Engines/Liquid.js
@@ -116,13 +116,16 @@ class Liquid extends TemplateEngine {
116
line: 1,
117
col: 1 }*/
118
if (arg.type.indexOf("ignore:") === -1) {
119
- argArray.push(await engine.evalValue(arg.value, scope));
+ // Push the promise into an array instead of awaiting it here.
120
+ // This forces the promises to run in order with the correct scope value for each arg.
121
+ // Otherwise they run out of order and can lead to undefined values for arguments in layout template shortcodes.
122
+ argArray.push(engine.evalValue(arg.value, scope));
123
}
124
arg = lexer.next();
125
126
127
- return argArray;
128
+ return await Promise.all(argArray);
129
130
131
static _normalizeShortcodeScope(ctx) {
0 commit comments