question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to disable HTML encoding of values

See original GitHub issue

Even though Handlebars is mainly used for producing HTML templates, it’s a great tool that could be used for generating any other types of content.

With Handlebars.Net there is a caveat though - HTML escape is always used (unless explicitly turned off in the template or helper), meaning that any non-HTML template would have a lot of unnecessary noise ({{{…}}} or custom helpers) to alleviate this (one of the reasons why it matters is that EncodedTextWriteris a bit too strict and encodes everything above char 159, compared to Handlebars.js that only encodes symbols &<>"'`=)

The handlebars.js has an option noEscape which is helpful in exactly this situation.

So this issue is basically a feature request to include this noEscape capability in the Handlebars.Net either in the form of configuration option or as an extension point for custom-written TextWriter

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
imsedimcommented, May 21, 2016

Example of how to turn off the encoding:

var configuration = new HandlebarsConfiguration { TextEncoder = null };

0reactions
rexmcommented, May 20, 2016

Fixed in #120, released in nuget package version 1.7.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable input from encoding html - javascript
When you want to get some input from the user and directly display it, be always aware of this. Try this, var value...
Read more >
Option to disable HTML encoding of values · Issue #119
The handlebars.js has an option noEscape which is helpful in exactly this situation. So this issue is basically a feature request to include ......
Read more >
Option to switch off encoding of parameters itself
I would really wish to have an option to switch of the %-encoding of the parameter values. My case is as follows: I...
Read more >
GridView - How to disable html encoding for Preview Row
We have introduced a special property that allows you to enable or disable encoding in the Preview Row element in v16.1: ASPxGridView.
Read more >
Disable html encoding in grid column in Kendo UI for Angular
Is there a way to allow html in a column? <kendo-grid-column field="description" title="Description" [encoded]="false"></kendo-grid-column> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found