Rocket: Expose internal template system for improved usability

Created on 25 Dec 2016  路  3Comments  路  Source: SergioBenitez/Rocket

I think it would be useful if the internal template system鈥擧andlebars or Tera鈥攚as exposed somewhere, so that it would be possible to make more template-specific modifications.

For some context, I'm using Handlebars, and I want to output a string containing HTML, however, Handlebars escapes strings by default. Hopefully this isn't a case of the XY problem, but I figure the best way I could solve this issue would be to acquire a reference to the static HANDLEBARS object, so that I could mess with the escape_fn settings or add a custom Helper.

question

Most helpful comment

With handlebars, you can use three curly braces instead of two to render the raw HTML:

{{{ my_html }}}

Does that get you what you're looking for?

All 3 comments

With handlebars, you can use three curly braces instead of two to render the raw HTML:

{{{ my_html }}}

Does that get you what you're looking for?

Oh, yes! That does work.

Huh, now that you point that out, I see it's documented on the handlebarsjs site, but not the handlebars-rust docs (as far as I can tell), so that's how I missed it.

Thank you! Rocket is looking really awesome, great work!

Awesome! And thanks for the kind words. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

denysvitali picture denysvitali  路  3Comments

incker picture incker  路  3Comments

ndarilek picture ndarilek  路  3Comments

PSeitz picture PSeitz  路  3Comments

Turakar picture Turakar  路  4Comments