Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation is not being preserved in nested partials #100

Open
wichon opened this issue Jun 24, 2021 · 1 comment
Open

Indentation is not being preserved in nested partials #100

wichon opened this issue Jun 24, 2021 · 1 comment

Comments

@wichon
Copy link

wichon commented Jun 24, 2021

Indentation is not working for nested partials, nested partials are getting an extra indentation level for subsequent lines in the partial, and the lines after the partial is rendered back in the upper level template don't return to their indentation level.

For example, I am using the command line (eg. chevron -d data.json main.mustache with an empty data.json) and the following mustache template files:

# main.mustache
  \
  {{>partial1}}
  /

# partial1.mustache
|
{{>partial2}}
|

# partial2.mustache
[
{{>partial3}}
]

# partial3.mustache
<
>

And the expected output should be:

  \
  |
  [
  <
  >
  ]
  |
  /

But I am getting:

  \
  |
  [
    <
        >
]
|
  /

One level nested partials work fine. This can cause an unwanted behavior specially for indentation sensitive file formats like YAML.

@sadiqkhoja
Copy link

having the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants