Open apatrida opened 5 years ago
(it appears it is setting the indentation of all lines to match the indentation of the partial import, if this {{> thingy}}
has 3 leading spaces, is it indenting the imported to match 3 leading spaces and destroying other indentation?`
Handlebars has a setting preventIndent
http://handlebarsjs.com/reference.html is that affecting this? But overall it isn't just indenting the content it is removing my own indentation and then indenting it. Which is evil.
I'm having the same problem. I am using foundation-emails and since the whole body of the emails gets imported by a partial it messes up the indentation of my <pre>
tags.
My quick fix was to add {preventIndent: true}
to the compile command in panini/lib/loadLayout.js
like this: this.layouts[name] = this.Handlebars.compile(file.toString(), {preventIndent: true});
Apparently there was already a PR to allow the preventIndet
option: #113
It even got merged into the 2.0 branch. Which hasn't been released in the last 2 years :/
When including a partial that has important indentation, for example:
This is imported as a partial as:
Which breaks the intention.