You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a template that shows German first and last names - something like
{{firstname}} {{lastname}}
If I provide a name like firstname="Peter", lastname="Müller", I get this in my result string:
Peter Müller
Is there any way in Handlebars.NET to AVOID this encoding? I just want the normal text "Peter Müller" back, since I need this inside an e-mail template.......
Generally e-mail clients handle encoded characters better than the expanded character sets. It is possible to introduce your own encoder that doesn't do this, on the Configuration object, but I'd wonder why for e-mail.
This is an issue for my Handlebars scaffolding for EF Core, which in general should suppress HTML encoding.
I noticed that EncodedTextWriter has a SuppressEncoding property. Would it be possible to add this property to HandlebarsConfiguration, so that HTML encoding could be suppressed?
HandlebarsJS has a configuration option noEscape that disables all encoding. I think a NoEscape boolean on configuration that controls/overrides the EncodedTextWriter would be appropriate.
Activity
rexm commentedon Dec 10, 2018
Generally e-mail clients handle encoded characters better than the expanded character sets. It is possible to introduce your own encoder that doesn't do this, on the Configuration object, but I'd wonder why for e-mail.
tonysneed commentedon Dec 27, 2018
This is an issue for my Handlebars scaffolding for EF Core, which in general should suppress HTML encoding.
I noticed that
EncodedTextWriterhas aSuppressEncodingproperty. Would it be possible to add this property toHandlebarsConfiguration, so that HTML encoding could be suppressed?tonysneed commentedon Dec 28, 2018
@rexm If you point me in the right direction, I can submit a PR for this.
rexm commentedon Apr 27, 2019
HandlebarsJS has a configuration option
noEscapethat disables all encoding. I think aNoEscapeboolean on configuration that controls/overrides the EncodedTextWriter would be appropriate.marcscheuner-bfh commentedon Apr 29, 2019
@rexm : yes, sounds very reasonable and would increase the usefulness of Handlebars.NET - you definitely got my vote on this one!
tonysneed commentedon Jul 17, 2019
👍 For adding this fix to the next version of Handlebars.NET.
`noEscape` support
`noEscape` support
`noEscape` support
`noEscape` support
`noEscape` support
tonysneed commentedon Oct 27, 2020
Is there now a NoEscape boolean on configuration?
oformaniuk commentedon Oct 28, 2020
Yes, it is available in latest master. Unfortunately it is not yet published.