diff --git a/core/src/template-string/parser.pegjs b/core/src/template-string/parser.pegjs index dce9954cce..a71456902e 100644 --- a/core/src/template-string/parser.pegjs +++ b/core/src/template-string/parser.pegjs @@ -187,7 +187,7 @@ Arguments } ArgumentList - = head:Expression tail:(__ "," __ Expression)* { + = head:PrimaryExpression tail:(__ "," __ PrimaryExpression)* { return buildList(head, tail, 3); } diff --git a/core/test/unit/src/template-string.ts b/core/test/unit/src/template-string.ts index 6e5b046d91..43ef4d8010 100644 --- a/core/test/unit/src/template-string.ts +++ b/core/test/unit/src/template-string.ts @@ -1041,6 +1041,11 @@ describe("resolveTemplateString", async () => { expect(res).to.equal("Zm9v") }) + it("resolves a template string in a helper argument", () => { + const res = resolveTemplateString("${base64Encode('${a}')}", new TestContext({ a: "foo" })) + expect(res).to.equal("Zm9v") + }) + it("resolves a helper function with multiple arguments", () => { const res = resolveTemplateString("${split('a,b,c', ',')}", new TestContext({})) expect(res).to.eql(["a", "b", "c"])