Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper params are not processed correctly #50

Open
neuronix opened this issue Mar 7, 2012 · 4 comments
Open

Helper params are not processed correctly #50

neuronix opened this issue Mar 7, 2012 · 4 comments

Comments

@neuronix
Copy link

neuronix commented Mar 7, 2012

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
Copy link
Author

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
Copy link

vybs commented Mar 29, 2012

We now have our fork on github

https://github.com/linkedin/dustjs

@neuronix
Copy link
Author

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

@vybs
Copy link

vybs commented Mar 31, 2012

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants