Skip to content

How to add proper indentation level when using a partial ? #603

Closed

Description

@PsyCowpathe

Hi, I can't find a solution to my problem so I need your help.

/!\ I dont know why but github mess up with all the code snippet, so i put pastebin link instead, i hope its fine

I use Handlebars.net to generate XML files.

Everything works fine, except when I use a partial --> Here

The Helper withExtractPostalAddress who is called in the partial --> Here

This partial is called in my .handlebar like this --> Here

And is initialized like this -> Here

The problem is that on output I end up with this --> Here

As you can see the indent level for everything in 'cac:PostalAddress' is incorrect.
Do you have any idea what I'm doing wrong?

Thanks in advance for your help !

Activity

  1. rexm commented on Jun 20, 2026

    @rexm
    Member

    This is being addressed by PR #635 (fix: preserve partial indentation). When a partial call is the only non-whitespace content on a line, the leading spaces/tabs are captured and applied to every line of the partial's output. Will close this when that PR merges.

  2. rexm commented on Jun 20, 2026

    @rexm
    Member

    Resolved by PR #635 (merged). Partial indentation is now automatically applied — leading spaces/tabs on a partial invocation line are prepended to every line of the partial's output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions