akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 131 forks source link

Helper params are not processed correctly #50

Open neuronix opened 12 years ago

neuronix commented 12 years ago

In the documentation, one may read :

Parameters accept interpolated string literals as values: {#snippet id="{name}_id"/}

However, here is a test case that shows that it currently does not work :

Template Test: {#helper foo="{name}_2"/}

Context { "name": "tester", "helper": function(chunk, context, bodies, params) { return chunk.write(params.foo); } }

Expected Output Test: tester_2

Effective Output Test: function body_1(chk,ctx){return chk.reference(ctx.get("name"),ctx,"h").write("_2");}

neuronix commented 12 years ago

Ok, i've found the solution by reading the Lindekin repository gists.

Here is a gist for future reference : https://gist.github.com/2016071

vybs commented 12 years ago

We now have our fork on github

https://github.com/linkedin/dustjs

neuronix commented 12 years ago

Thanks ! dustjs is awesome but the main repo seems abandonned.

vybs commented 12 years ago

We want to accept pull requests and maintain until the creator responds.

Yes, it is one of the elegant ones I have used.