Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Handlebars-Net/Handlebars.Net
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.4.0
Choose a base ref
...
head repository: Handlebars-Net/Handlebars.Net
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.4.1
Choose a head ref
  • 6 commits
  • 15 files changed
  • 3 contributors

Commits on Aug 7, 2026

  1. 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]>
    rexm and claude committed Aug 7, 2026
    Configuration menu
    Copy the full SHA
    e2d3dc2 View commit details
    Browse the repository at this point in the history
  2. 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]>
    rexm and claude committed Aug 7, 2026
    Configuration menu
    Copy the full SHA
    a2a3dd6 View commit details
    Browse the repository at this point in the history
  3. 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]>
    rexm and claude committed Aug 7, 2026
    Configuration menu
    Copy the full SHA
    4832a72 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #664 from Handlebars-Net/fix/issue-660-safestring-…

    …leak
    
    fix: stop leaking internal SafeString type through subexpression results (issue #660)
    rexm authored Aug 7, 2026
    Configuration menu
    Copy the full SHA
    08efad6 View commit details
    Browse the repository at this point in the history
  5. Merge remote-tracking branch 'origin/master' into fix/issue-661-crlf-…

    …normalization
    
    # Conflicts:
    #	source/Handlebars.Test/IssueTests.cs
    rexm committed Aug 7, 2026
    Configuration menu
    Copy the full SHA
    5d4a6c0 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #663 from Handlebars-Net/fix/issue-661-crlf-normal…

    …ization
    
    fix: preserve literal line endings in static template text (issue #661)
    rexm authored Aug 7, 2026
    Configuration menu
    Copy the full SHA
    bb496ab View commit details
    Browse the repository at this point in the history
Loading