Download Latest Version 2.4.3 source code.zip (413.5 kB)
Email in envelope

Get an email when there's a new version of Handlebars.Net

Home / 2.4.1
Name Modified Size InfoDownloads / Week
Parent folder
2.4.1 source code.tar.gz 2026-08-07 211.4 kB
2.4.1 source code.zip 2026-08-07 407.6 kB
README.md 2026-08-07 2.0 kB
Totals: 3 Items   621.0 kB 0

Fixes

Both regressions below were introduced on 2026-06-20 and shipped in 2.4.0 (released 2026-08-06). Neither was an intentional public API change — this release restores prior correct behavior.

  • Static template text no longer has its line endings silently rewritten. A fix for internal indentation handling started normalizing every \r\n/\r in static template text to \n, so a literal \r\n a caller wrote into a template string (e.g. between {{#each}} iterations) was silently turned into \n. Static text now round-trips verbatim, matching this library's long-standing behavior and handlebars.js. (#663, fixes [#661])
  • Subexpression results are plain strings again, not an internal wrapper type. A fix for double-encoding across subexpression boundaries (#543) wrapped every writer-based helper's captured output in an internal sealed class SafeString when used as a subexpression argument. Only a few internal call sites knew how to unwrap it — any other consumer, including reflection-based/typed helper binders in third-party packages (e.g. Handlebars.Net.Helpers), received an opaque type it could neither cast to string nor unwrap, throwing InvalidCastException. The double-encoding fix is preserved, but the signal is now carried by an invisible reference-keyed marker instead of a boxing type, so the value is a genuine System.String everywhere except the one place that needs to know. (#664, fixes [#660])

Compatibility notes

  • No API surface changes. Both fixes are behavior reverts to what 2.3.0 and earlier already did; anything that worked before 2.4.0 works the same way again.
  • If your code adapted to either regression (e.g. expected \n-only output regardless of source line endings, or handled a SafeString-typed subexpression argument), that adaptation is no longer necessary but should remain harmless.

Contributors

@rexm

Full Changelog: https://github.com/Handlebars-Net/Handlebars.Net/compare/2.4.0...2.4.1

Source: README.md, updated 2026-08-07