-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
No output... #7
Comments
I posted an answer on stackoverflow, but I'll put it here too: This helper was built to be used in assemble so there's a var handlebars = require("handlebars");
var helpers = require('prettify');
helpers.register(handlebars);
var templateHtml = "{{#prettify}}<div class='entry'><h1>{{title}}</h1><div class='body'>{{body}}</div></div>{{/prettify}}";
var templater = handlebars.compile(templateHtml);
var transformedHtml = templater({
title: "Hello World",
body: "De kat krabt de krullen van de trap"
});
console.log(transformedHtml); That should work. Notice that prettify returns a Handlebars.SafeString() so |
Hi doowb, I accepted the answer on stackoverflow. Thanks! My comment on stackoverflow: Hi doowb, that did definitly do the job. Could you add this to the documentation on page github.com/helpers/handlebars-helper-prettify? |
sounds like this was resolved, thanks @doowb! |
please reopen if necessary, thanks for reporting it @svdoever |
I posted this already on stackoverflow (http://stackoverflow.com/questions/24152877/handlebars-handlebars-helper-prettify-in-node-js-empty-result), but this seems a better place:
I try to use Handlebars with the prettify helper using the following code:
But I get an empty result. What am I missing here? If I remove {{#prettify} and {{/prettify}} it works (but it is not pretty-printed!)
The text was updated successfully, but these errors were encountered: