return new Handlebars.SafeString(result); throws Uncaught TypeError: undefined is not a function #160
Comments
I've found SafeString to not be supported by Handlebars, you can instead do:
As I haven't used a helper that way I don't know if the closing tag is necessary, then it would be:
|
Strangely it is allowing me to do {{#testme}}{{/testme}} Is this correct? |
@stephentcannon: Uhm, just to be sure, with two surrounding |
two surrounding braces on each side |
@stephentcannon: I haven't actually seen any example that shows you can In any case, two comments ago I've shown a way to make sure the HTML isn't getting escaped. |
Yep, thank you very much. This one goes in my list of things never to forget. |
We don't have Handlebars.SafeString in Meteor at the moment. This syntax:
I suppose the point of SafeString is that you don't have to be diligent about calling a helper with the right number of curly braces. |
@dgreensp: According to the Helpers part under http://handlebarsjs.com/expressions.html I would assume that |
@TomWij: Well, |
Trying to return HTML markup into a Template from a Handlebars helper throws an Uncaught TypeError
Helper
Template
{{#testme }}{{/testme}}
Result in browser console
Uncaught TypeError: undefined is not a function
This appears to be offending statement because you can return 'a' without safestring method call and it works fine except that the content returned is not HTML and displayed as raw text.
return new Handlebars.SafeString(a);
The text was updated successfully, but these errors were encountered: