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

How to escape encoding html tags #55

Closed
zoranpro opened this issue Jun 11, 2015 · 2 comments
Closed

How to escape encoding html tags #55

zoranpro opened this issue Jun 11, 2015 · 2 comments

Comments

@zoranpro
Copy link

Hi,

I am having Object data which value contains <br />. When I invoke the template I got encoded characters. Is there a possibility to keep <br />?

                var template = Handlebars.Compile(text);
                var data = new {
                    Signature =  "Some text <br /> some text"
                };

                string result = template(data);

As a result i get this &lt;br /&gt;. I would like to get <br />

@rexm
Copy link
Member

rexm commented Jun 11, 2015

Use the triple-stash syntax:

{{{signature}}}

Note this is the same as calling WriteSafeString from inside a helper - it assumes you've done the necessary work to ensure that string is safe and does not need to be escaped.

@rexm rexm closed this as completed Jun 11, 2015
@zoranpro
Copy link
Author

That solved it. Thanks.

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