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

.template method will replace keys that do not exist with empty string #117

Merged

Conversation

az7arul
Copy link
Collaborator

@az7arul az7arul commented Sep 28, 2014

If the key does not exist current template method keeps the {{ _ }} string as is. Replacing it with empty string seems to be helpful.

@az7arul
Copy link
Collaborator Author

az7arul commented Oct 12, 2014

@jprichardson any thoughts ?

@jprichardson
Copy link
Owner

Ya, I think this is good :) Sorry for the delayed response, I'll take care
of this within a week.

On Sun, Oct 12, 2014 at 7:50 AM, Azharul Islam notifications@github.com
wrote:

@jprichardson https://github.com/jprichardson any thoughts ?


Reply to this email directly or view it on GitHub
#117 (comment)
.

Simple & Secure Bitcoin Wallet: https://www.coinbolt.com
Bitcoin / JavaScript: http://cryptocoinjs.com
Follow me on Twitter: http://twitter.com/jprichardson

@jprichardson
Copy link
Owner

Actually, I'm not so sure about this one. What is the default behavior in lodash or underscore? I think that it should follow those libraries as much as possible as those will be the expected behavior.

@az7arul
Copy link
Collaborator Author

az7arul commented Oct 15, 2014

underscore/lodash interpolate have the same behaviour.

var compiled = _.template("hello: <%= name %>");
compiled({});
=> "hello: "

They also have the capability of executing javascript and escaping HTML ( I can work on adding them here as well if thats in the vision.)

@jprichardson
Copy link
Owner

OK, sounds good. Could you resubmit this PR with the new master? (I can't automerge)

@az7arul az7arul force-pushed the template-replace-non-existant-key branch from cbfa139 to b179720 Compare October 20, 2014 10:41
@az7arul
Copy link
Collaborator Author

az7arul commented Oct 20, 2014

@jprichardson done

jprichardson added a commit that referenced this pull request Oct 20, 2014
.template method will replace keys that do not exist with empty string
@jprichardson jprichardson merged commit 5de7ec1 into jprichardson:master Oct 20, 2014
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

Successfully merging this pull request may close these issues.

2 participants