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

Handlebars compile options aren't passed through. #22

Open
HowlingEverett opened this issue Oct 8, 2015 · 1 comment
Open

Handlebars compile options aren't passed through. #22

HowlingEverett opened this issue Oct 8, 2015 · 1 comment

Comments

@HowlingEverett
Copy link
Contributor

The JSDoc for this.render suggests that we can pass additional options for Handlebars as the third argument after template name and locals.

However, Handlebars requires that these options be passed to the handlebars.compile function as a second argument. Instead they're being passed into the resulting render function where they're being silently ignored.

This means something like this.render('my-template', {foo: 'bar'}, {preventIndent: true}) won't work as expected.

HowlingEverett added a commit to HowlingEverett/koa-handlebars that referenced this issue Oct 8, 2015
The quickest/dirtiest way of fixing dominicbarnes#22 is to hold those options passed
on this.render on the instance, then use them when `handlebars.compile`
is calling `compileTemplate`.
@dominicbarnes
Copy link
Owner

Oh, I don't think I ever accounted for compile options before. The options there are passed directly during render, which is described here. (so it supports data, helpers, partials)

I'm open to a way to add compile options though, although it's an additional feature instead of a bug fix at this point. :)

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