Repository navigation
Comparing changes
Open a pull request
base repository: Handlebars-Net/Handlebars.Net
base: 2.4.0
head repository: Handlebars-Net/Handlebars.Net
compare: 2.4.1
- 6 commits
- 15 files changed
- 3 contributors
Commits on Aug 7, 2026
-
fix: preserve literal line endings in static template text (issue #661)
StaticConverter unconditionally rewrote \r\n/\r to \n in every static text token, and PartialBinder.WriteWithIndent did the same for indented partial content — both added 2026-06-20 to paper over an internal inconsistency between the two (WriteWithIndent normalized while the surrounding static text didn't, producing mixed line endings within a single render). That fix overshot: it silently rewrote line endings the caller explicitly put in a template string, e.g. explicit \r\n between {{#each}} iterations. Static text is the caller's literal content and must round-trip verbatim, matching handlebars.js and this library's own behavior prior to that change. Removed the rewrite from both places; WriteWithIndent now scans the original content directly, since a \r immediately before a split point rides along with its segment for free. Reverted the test-expectation edits from that commit back to their original \r\n assertions, and added regression coverage: explicit \r\n and \n preservation, an Environment.NewLine-based test that exercises \r\n on Windows and \n on macOS/Ubuntu via the existing 3-OS CI matrix, and an indented-partial CRLF case matching the WriteWithIndent path. Co-Authored-By: Claude Sonnet 5 <[email protected]>Configuration menu - View commit details
-
Copy full SHA for e2d3dc2 - Browse repository at this point
Copy the full SHA e2d3dc2View commit details -
fix: stop leaking internal SafeString type through subexpression resu…
…lts (issue #660) ReturnInvoke (added for issue #543, 2026-06-20) wrapped every writer-based helper's captured output in an internal sealed SafeString when used as a subexpression, so the outer expression wouldn't double-encode already-safe content. But only a few internal call sites were taught to unwrap it (EncodedTextWriter.Write<T>, WriteSafeString(object), HandlebarsUtils.IsFalsy, PartialBinder) — any other consumer, including reflection-based/typed helper binders in third-party packages this library has no visibility into, received an opaque internal type it could neither cast to string nor unwrap. Replaced the wrapper type with SafeStrings, a ConditionalWeakTable-backed marker keyed by object reference. ReturnInvoke now returns the captured string itself, invisibly marked as already-encoded, instead of boxing it in a new type. The value stays a genuine System.String all the way through — castable, reflectable, and indistinguishable from any other string to every consumer except the encoding writer, which is the only place the signal actually needs to matter. This also let PartialBinder revert to its original Cast<string>(pex.PartialName) and dropped the now-redundant SafeString cases in HandlebarsUtils.IsFalsy and HandlebarsExtensions.WriteSafeString(object). Added regression coverage: a subexpression's captured result is asserted to be typeof(string) and to survive a direct (string) cast, mirroring the reporter's Append(string, string) helper receiving a subexpression argument. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a2a3dd6 - Browse repository at this point
Copy the full SHA a2a3dd6View commit details -
fix: add .gitattributes to force LF checkout, fixing Windows CI failures
PR #663 removed StaticConverter's blanket \r\n->\n rewrite (issue #661), which was incidentally papering over a second, separate problem: several tests embed multi-line template content as verbatim/raw C# string literals (actual embedded newlines in the .cs source) and assert against an explicit \n-based expected value. With no .gitattributes, Windows runners/clients default core.autocrlf=true and check those literals out as \r\n, so once Handlebars.Net stopped silently normalizing render output, TestNestedPartials and Issue519_PartialBlockUsableAsBlockAndInIf failed on windows-latest CI (confirmed via the PR's own check run). Forcing LF at checkout is the correct fix for that problem: it makes the checked-out source deterministic across platforms instead of asking the render pipeline to paper over a source-control inconsistency. The tracked blobs are already LF (verified via git show | od), so no --renormalize pass is needed — this only changes how future checkouts materialize them. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4832a72 - Browse repository at this point
Copy the full SHA 4832a72View commit details -
Merge pull request #664 from Handlebars-Net/fix/issue-660-safestring-…
…leak fix: stop leaking internal SafeString type through subexpression results (issue #660)
Configuration menu - View commit details
-
Copy full SHA for 08efad6 - Browse repository at this point
Copy the full SHA 08efad6View commit details -
Merge remote-tracking branch 'origin/master' into fix/issue-661-crlf-…
…normalization # Conflicts: # source/Handlebars.Test/IssueTests.cs
Configuration menu - View commit details
-
Copy full SHA for 5d4a6c0 - Browse repository at this point
Copy the full SHA 5d4a6c0View commit details -
Merge pull request #663 from Handlebars-Net/fix/issue-661-crlf-normal…
…ization fix: preserve literal line endings in static template text (issue #661)
Configuration menu - View commit details
-
Copy full SHA for bb496ab - Browse repository at this point
Copy the full SHA bb496abView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 2.4.0...2.4.1