samvincent / jekyll-haml

HAML html converter for Jekyll
MIT License
88 stars 40 forks source link

removes newlines from `{% haml %}` includes #27

Closed pedrozath closed 6 years ago

pedrozath commented 6 years ago

Yesterday I stumbled upon the problem that I wasn't able to include files properly in the way I expected. For example, this code:

.content
  {% haml portfolio/nav_jobs.haml %}

  %main
    something here

Would render as:

<div class="content">
  <nav class="left-column" >
<header>
</header>
</nav>
  %main
    something here

And as you may see, it would give an error of Illegal nesting: nesting within plain text is illegal. Even when I managed to make it work, only <nav> would be part of .content, the rest would be on top level.

What this simple PR does is stripping newlines so that rendered partials won't enter in the indentation game, making it behave in much more predictable way.

samvincent commented 6 years ago

Thanks, jekyll-haml-0.1.6.gem released