You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having an issue with a subexpression being encoded/escaped when I have something like this:
{{func1 (func2)}}
where func1 and func2 are helpers I have defined.
Prior to v2, this was working fine as long as func2 did "writer.Write(output)". In v2, I can make this work if I change that to "writer.Write(output, false)". But then I have issues if I try to use func2 on it's own like this:
{{func2}}
I can't find any way in v2 to make this work consistently. Is this a bug? Or is there some way I can know inside func2 whether it is being used in a subexpression?
The text was updated successfully, but these errors were encountered:
[Fact]publicvoidSubExpressionsEncoding(){varhandlebars=Handlebars.Create();handlebars.RegisterHelper("func1",(writer,context,args)=>{writer.Write(args[0]);});handlebars.RegisterHelper("func2",(writer,context,args)=>{writer.Write("test&test");});vartemplate=handlebars.Compile("{{func2}}");varoutput=template(new{});Assert.Equal("test&test",output);// This test will pass if you change func2 to writer.Write("test&test", false) but then the first test failstemplate=handlebars.Compile("{{func1 (func2)}}");output=template(new{});Assert.Equal("test&test",output);}
I am having an issue with a subexpression being encoded/escaped when I have something like this:
where func1 and func2 are helpers I have defined.
Prior to v2, this was working fine as long as func2 did "writer.Write(output)". In v2, I can make this work if I change that to "writer.Write(output, false)". But then I have issues if I try to use func2 on it's own like this:
I can't find any way in v2 to make this work consistently. Is this a bug? Or is there some way I can know inside func2 whether it is being used in a subexpression?
The text was updated successfully, but these errors were encountered: