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

Lack of Handlebars.SafeString Support #25

Closed
shahyar opened this issue Apr 10, 2014 · 1 comment · Fixed by #31
Closed

Lack of Handlebars.SafeString Support #25

shahyar opened this issue Apr 10, 2014 · 1 comment · Fixed by #31

Comments

@shahyar
Copy link
Contributor

shahyar commented Apr 10, 2014

In Handlebars.js, you can bypass the string escaping when using a Helper function by wrapping your return string with Handlebars.SafeString(String). However, such a thing doesn't appear to exist in lightncandy. It also provides Handlebars.Utils.escapeExpression(String) for manual escaping in such a scenario.

ebernhardson added a commit to ebernhardson/lightncandy that referenced this issue Apr 11, 2014
Handlebars.js and other templating engines offer a way to return a value
from a helper and not have it escaped based on the helpers choice, rather
than the templates.  This adds a new feature flag and associated code to
create a new LCSafeString class.  When returned from a helper the contents
of the LCSafeString are output as-is.

There may be some interactions with LCRun2::raw that i don't understand yet.

Addresses zordius#25
ebernhardson added a commit to ebernhardson/lightncandy that referenced this issue Apr 11, 2014
Handlebars.js and other templating engines offer a way to return a value
from a helper and not have it escaped based on the helpers choice, rather
than the templates.  This adds a new feature flag and associated code to
create a new LCSafeString class.  When returned from a helper the contents
of the LCSafeString are output as-is.

There may be some interactions with LCRun2::raw that i don't understand yet.

Addresses zordius#25
@zordius
Copy link
Owner

zordius commented Apr 15, 2014

I have some idea in #28 , please comments for your requirement and verify my design, thanks.

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

Successfully merging a pull request may close this issue.

2 participants