helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

raw helper #343

Open yoann217 opened 5 years ago

yoann217 commented 5 years ago

hello, When using raw helper like in the example {{{{#raw}}}} {{foo}} {{{{/raw}}}} I got this error Error: Parse error on line 1: { ----^ Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'

So I try like this {{{{raw}}}} {{foo}} {{{{/raw}}}}

And the output was now \{{foo}} (yes with the backslash)

So how to get the same output of the example ?

unValerio commented 5 years ago

I have the same issue, so I had to replace this helper.

As I use express-handlebars I just replace it when registering:

helpers: Object.assign(HandlebarsHelpers(), {
    raw: function(options) {
        return options.fn(this)
    }
})