Skip to content

Commit

Permalink
fix(glimmer): add softline in nested block statements (#4896)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchak authored and duailibe committed Jul 26, 2018
1 parent 9668426 commit 505e082
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/language-handlebars/printer-glimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function print(path, options, print) {
group(
concat([
indent(concat([softline, path.call(print, "program")])),
hasParams && hasChildren ? hardline : "",
hasParams && hasChildren ? hardline : softline,
printCloseBlock(path, print)
])
)
Expand Down
27 changes: 27 additions & 0 deletions tests/html_glimmer/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ exports[`block-statement.hbs - glimmer-verify 1`] = `
{{/block}}
{{/block}}
{{#block}}
{{#block param}}
hello
{{/block}}
{{/block}}
{{#block param}}
{{#block param}}
hello
{{/block}}
{{/block}}
{{#block}}
hello
{{/block}}
<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
Expand Down Expand Up @@ -98,6 +114,17 @@ exports[`block-statement.hbs - glimmer-verify 1`] = `
Hello
{{/block}}
{{#block}}{{#block}}hello{{/block}}{{/block}}
{{#block}}
{{#block param}}
hello
{{/block}}
{{/block}}
{{#block param}}
{{#block param}}
hello
{{/block}}
{{/block}}
{{#block}}hello{{/block}}
<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
Expand Down
16 changes: 16 additions & 0 deletions tests/html_glimmer/block-statement.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
{{/block}}
{{/block}}

{{#block}}
{{#block param}}
hello
{{/block}}
{{/block}}

{{#block param}}
{{#block param}}
hello
{{/block}}
{{/block}}

{{#block}}
hello
{{/block}}

<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
Expand Down

0 comments on commit 505e082

Please sign in to comment.