- A long enough string to trigger a line break that would prevent wrapping.
-
-
- A long enough string to trigger a line break that would prevent wrapping more.
-
-
- A long enough string to trigger a line break that would prevent wrapping more and more.
-
-
- {{#block}}
- {{hello}}
- {{/block}}
-
-
- {{hello}}
-
-
-
-================================================================================
-`;
-
-exports[`else-if.hbs 1`] = `
-====================================options=====================================
-parsers: ["glimmer"]
-printWidth: 80
- | printWidth
-=====================================input======================================
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- e
-{{/if}}
-
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- hello
- {{#if f}}
- g
- {{/if}}
- e
-{{/if}}
-
-{{#if a}}
- b
-{{else if c}}
- d
-{{else if e}}
- f
-{{else if g}}
- h
-{{else}}
- j
-{{/if}}
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
-{{#if a}}
- b
-{{else}}
- {{#each c as |d|}}
- e
- {{/each}}
-{{/if}}
-
-{{#if a}}
- {{#if b}}
- ab
- {{else if c}}
- ac
- {{/if}}
-{{/if}}
-
-{{#if a}}
- a
-
b
- c
-{{else}}
- {{#if c}}
- a
- b
-
c
- {{/if}}
-
a
- b
- c
-{{/if}}
-
-=====================================output=====================================
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- e
-{{/if}}
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- hello
- {{#if f}}
- g
- {{/if}}
- e
-{{/if}}
-{{#if a}}
- b
-{{else if c}}
- d
-{{else if e}}
- f
-{{else if g}}
- h
-{{else}}
- j
-{{/if}}
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-{{#if a}}
- b
-{{else}}
- {{#each c as |d|}}
- e
- {{/each}}
-{{/if}}
-{{#if a}}
- {{#if b}}
- ab
- {{else if c}}
- ac
- {{/if}}
-{{/if}}
-{{#if a}}
- a
-
- b
-
- c
-{{else}}
- {{#if c}}
- a
- b
-
- c
-
- {{/if}}
-
- a
-
- b
- c
-{{/if}}
-================================================================================
-`;
-
-exports[`else-if.hbs 2`] = `
-====================================options=====================================
-parsers: ["glimmer"]
-printWidth: 80
-singleQuote: true
- | printWidth
-=====================================input======================================
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- e
-{{/if}}
-
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- hello
- {{#if f}}
- g
- {{/if}}
- e
-{{/if}}
-
-{{#if a}}
- b
-{{else if c}}
- d
-{{else if e}}
- f
-{{else if g}}
- h
-{{else}}
- j
-{{/if}}
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
-{{#if a}}
- b
-{{else}}
- {{#each c as |d|}}
- e
- {{/each}}
-{{/if}}
-
-{{#if a}}
- {{#if b}}
- ab
- {{else if c}}
- ac
- {{/if}}
-{{/if}}
-
-{{#if a}}
- a
-
b
- c
-{{else}}
- {{#if c}}
- a
- b
-
c
- {{/if}}
-
a
- b
- c
-{{/if}}
-
-=====================================output=====================================
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- e
-{{/if}}
-{{#if a}}
- b
-{{else if c}}
- d
-{{else}}
- hello
- {{#if f}}
- g
- {{/if}}
- e
-{{/if}}
-{{#if a}}
- b
-{{else if c}}
- d
-{{else if e}}
- f
-{{else if g}}
- h
-{{else}}
- j
-{{/if}}
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-
- {{#if a}}
- b
- {{else if c}}
- d
- {{else}}
- e
- {{/if}}
-
-
-{{#if a}}
- b
-{{else}}
- {{#each c as |d|}}
- e
- {{/each}}
-{{/if}}
-{{#if a}}
- {{#if b}}
- ab
- {{else if c}}
- ac
- {{/if}}
-{{/if}}
-{{#if a}}
- a
-
+{{#if isAtWork}}
+ Ship that code!
+{{else if isReading}}
+ You can finish War and Peace eventually...
+{{else}}
+ Go to bed!
+{{/if}}
+
+
+
+{{#if a}}
+ A
+{{else}}
+ B
+{{/if}}
+
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ e
+{{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ hello
+ {{#if f}}
+ g
+ {{/if}}
+ e
+{{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else if e}}
+ f
+{{else if g}}
+ h
+{{else}}
+ j
+{{/if}}
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+{{#if a}}
+ b
+{{else}}
+ {{#each c as |d|}}
+ e
+ {{/each}}
+{{/if}}
+
+{{#if a}}
+ {{#if b}}
+ ab
+ {{else if c}}
+ ac
+ {{/if}}
+{{/if}}
+
+{{#if a}}
+ a
+
b
+ c
+{{else}}
+ {{#if c}}
+ a
+ b
+
c
+ {{/if}}
+
a
+ b
+ c
+{{/if}}
+
+=====================================output=====================================
+
+ {{#if isAtWork}}
+ Ship that code!
+ {{else if isReading}}
+ You can finish War and Peace eventually...
+ {{else}}
+ Go to bed!
+ {{/if}}
+
+
+ {{#if a}}
+ A
+ {{else}}
+ B
+ {{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ e
+{{/if}}
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ hello
+ {{#if f}}
+ g
+ {{/if}}
+ e
+{{/if}}
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else if e}}
+ f
+{{else if g}}
+ h
+{{else}}
+ j
+{{/if}}
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+{{#if a}}
+ b
+{{else}}
+ {{#each c as |d|}}
+ e
+ {{/each}}
+{{/if}}
+{{#if a}}
+ {{#if b}}
+ ab
+ {{else if c}}
+ ac
+ {{/if}}
+{{/if}}
+{{#if a}}
+ a
+
+{{#if isAtWork}}
+ Ship that code!
+{{else if isReading}}
+ You can finish War and Peace eventually...
+{{else}}
+ Go to bed!
+{{/if}}
+
+
+
+{{#if a}}
+ A
+{{else}}
+ B
+{{/if}}
+
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ e
+{{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ hello
+ {{#if f}}
+ g
+ {{/if}}
+ e
+{{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else if e}}
+ f
+{{else if g}}
+ h
+{{else}}
+ j
+{{/if}}
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+{{#if a}}
+ b
+{{else}}
+ {{#each c as |d|}}
+ e
+ {{/each}}
+{{/if}}
+
+{{#if a}}
+ {{#if b}}
+ ab
+ {{else if c}}
+ ac
+ {{/if}}
+{{/if}}
+
+{{#if a}}
+ a
+
b
+ c
+{{else}}
+ {{#if c}}
+ a
+ b
+
c
+ {{/if}}
+
a
+ b
+ c
+{{/if}}
+
+=====================================output=====================================
+
+ {{#if isAtWork}}
+ Ship that code!
+ {{else if isReading}}
+ You can finish War and Peace eventually...
+ {{else}}
+ Go to bed!
+ {{/if}}
+
+
+ {{#if a}}
+ A
+ {{else}}
+ B
+ {{/if}}
+
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ e
+{{/if}}
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else}}
+ hello
+ {{#if f}}
+ g
+ {{/if}}
+ e
+{{/if}}
+{{#if a}}
+ b
+{{else if c}}
+ d
+{{else if e}}
+ f
+{{else if g}}
+ h
+{{else}}
+ j
+{{/if}}
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+
+ {{#if a}}
+ b
+ {{else if c}}
+ d
+ {{else}}
+ e
+ {{/if}}
+
+
+{{#if a}}
+ b
+{{else}}
+ {{#each c as |d|}}
+ e
+ {{/each}}
+{{/if}}
+{{#if a}}
+ {{#if b}}
+ ab
+ {{else if c}}
+ ac
+ {{/if}}
+{{/if}}
+{{#if a}}
+ a
+
{{! This comment will not be in the output }}
{{!-- This comment as }} and will not be in the output --}}
diff --git a/tests/handlebars/jsfmt.spec.js b/tests/handlebars-comment/jsfmt.spec.js
similarity index 100%
rename from tests/handlebars/jsfmt.spec.js
rename to tests/handlebars-comment/jsfmt.spec.js
diff --git a/tests/handlebars-concat-statement/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars-concat-statement/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 00000000..fd651801
--- /dev/null
+++ b/tests/handlebars-concat-statement/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,118 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`concat-statement.hbs 1`] = `
+====================================options=====================================
+parsers: ["glimmer"]
+printWidth: 80
+ | printWidth
+=====================================input======================================
+
+ We are a cooperative, one of the few seed companies so organized
+ in the United States. Because we do not have an individual owner or beneficiary,
+ profit is not our primary goal. Consumers own 60% of the cooperative and worker
+ members 40%. Consumer and worker members share proportionately in the cooperative’s
+ profits through our annual patronage dividends.
+
+
+
+ We are a cooperative
+
+ , one of the few seed companies so organized
+ in the United States. Because we do not have an individual owner or beneficiary,
+ profit is not our primary goal. Consumers own 60% of the cooperative and worker
+ members 40%. Consumer and worker members share proportionately in the cooperative’s
+ profits through our annual patronage dividends.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec maximus rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec maximus rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
+
+=====================================output=====================================
+{{! TO FIX }}
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec
+ maximus
+
+ rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec
+
+ maximus
+
+
+ rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
+
+================================================================================
+`;
+
+exports[`non-breaking-whitespace.hbs 1`] = `
+====================================options=====================================
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+Prix : 32 €
+
+=====================================output=====================================
+
+
+ Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+
+
+ Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+
+
+ Prix : 32 €
+
+================================================================================
+`;
+
+exports[`punctuation.hbs 1`] = `
+====================================options=====================================
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+This is your name: {{name}}.
+This is your name: {{name}} (employee)
+This is your name: {{name}} ({{role}})
+
+=====================================output=====================================
+
+ This is your name: {{name}}.
+
+
+ This is your name: {{name}}(employee)
+
+
+ This is your name: {{name}}({{role}})
+
+================================================================================
+`;
+
+exports[`surrounding-linebreak.hbs 1`] = `
+====================================options=====================================
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+123
+
+123
+123
+
+
+123
+
+
+
;
diff --git a/tests/handlebars-whitespace/boss.hbs b/tests/handlebars-whitespace/boss.hbs
new file mode 100644
index 00000000..1e15a8a9
--- /dev/null
+++ b/tests/handlebars-whitespace/boss.hbs
@@ -0,0 +1,15 @@
+
Hi {{firstName}} {{lastName}} , welcome!
+{{#component propA}}
+ for {{propB}} do {{propC}} f
+{{/component}}
+{{#component propA}}
+ for {{propB}} namedo {{propC}} f
+{{/component}}
+{{propA}} {{propB}}
+{{propC}}{{propD}}
+{{propE}} {{propF}}
+{{propG}}{{propH}}
+
+
+
+hey
diff --git a/tests/glimmer/curly.hbs b/tests/handlebars-whitespace/curly.hbs
similarity index 100%
rename from tests/glimmer/curly.hbs
rename to tests/handlebars-whitespace/curly.hbs
diff --git a/tests/handlebars-whitespace/display-inline-block.hbs b/tests/handlebars-whitespace/display-inline-block.hbs
new file mode 100644
index 00000000..abb06852
--- /dev/null
+++ b/tests/handlebars-whitespace/display-inline-block.hbs
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/handlebars-whitespace/display-none.hbs b/tests/handlebars-whitespace/display-none.hbs
new file mode 100644
index 00000000..0570c11e
--- /dev/null
+++ b/tests/handlebars-whitespace/display-none.hbs
@@ -0,0 +1,2 @@
+{{!-- TO FIX --}}
+My tITlE
diff --git a/tests/handlebars-whitespace/fill.hbs b/tests/handlebars-whitespace/fill.hbs
new file mode 100644
index 00000000..3a475a42
--- /dev/null
+++ b/tests/handlebars-whitespace/fill.hbs
@@ -0,0 +1,11 @@
+
+ We are a cooperative, one of the few seed companies so organized
+ in the United States. Because we do not have an individual owner or beneficiary,
+ profit is not our primary goal. Consumers own 60% of the cooperative and worker
+ members 40%. Consumer and worker members share proportionately in the cooperative’s
+ profits through our annual patronage dividends.
+
diff --git a/tests/handlebars-whitespace/inline-element.hbs b/tests/handlebars-whitespace/inline-element.hbs
new file mode 100644
index 00000000..749afd13
--- /dev/null
+++ b/tests/handlebars-whitespace/inline-element.hbs
@@ -0,0 +1,16 @@
+{{!-- TO FIX --}}
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec maximus rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
+
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce cursus massa vel augue
+vestibulum facilisis in porta turpis. Ut faucibus lectus sit amet urna consectetur dignissim.
+Sam vitae neque quis ex dapibus faucibus at sed ligula. Nulla sit amet aliquet nibh.
+Vestibulum at congue mi. Suspendisse vitae odio vitae massa hendrerit mattis sed eget dui.
+Sed eu scelerisque neque. Donec maximus rhoncus pellentesque. Aenean purus turpis, vehicula
+euismod ante vel, ultricies eleifend dui. Class aptent taciti sociosqu ad litora torquent per
+conubia nostra, per inceptos himenaeos. Donec in ornare velit.
diff --git a/tests/handlebars-whitespace/jsfmt.spec.js b/tests/handlebars-whitespace/jsfmt.spec.js
new file mode 100644
index 00000000..36123c9a
--- /dev/null
+++ b/tests/handlebars-whitespace/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["glimmer"], { printWidth: 40 });
diff --git a/tests/handlebars-whitespace/non-breaking-whitespace.hbs b/tests/handlebars-whitespace/non-breaking-whitespace.hbs
new file mode 100644
index 00000000..55a8b947
--- /dev/null
+++ b/tests/handlebars-whitespace/non-breaking-whitespace.hbs
@@ -0,0 +1,6 @@
+
+Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+Nihil aut odit omnis. Quam maxime est molestiae. Maxime dolorem dolores voluptas quaerat ut qui sunt vitae error.
+
+Prix : 32 €
diff --git a/tests/handlebars-whitespace/punctuation.hbs b/tests/handlebars-whitespace/punctuation.hbs
new file mode 100644
index 00000000..762851bd
--- /dev/null
+++ b/tests/handlebars-whitespace/punctuation.hbs
@@ -0,0 +1,3 @@
+This is your name: {{name}}.
+This is your name: {{name}} (employee)
+This is your name: {{name}} ({{role}})
diff --git a/tests/handlebars-whitespace/surrounding-linebreak.hbs b/tests/handlebars-whitespace/surrounding-linebreak.hbs
new file mode 100644
index 00000000..06862eba
--- /dev/null
+++ b/tests/handlebars-whitespace/surrounding-linebreak.hbs
@@ -0,0 +1,17 @@
+123
+
+123
+123
+
+
+123
+
+
+
123
+
+123
+
123
+
+
+123
+
diff --git a/tests/handlebars-whitespace/table.hbs b/tests/handlebars-whitespace/table.hbs
new file mode 100644
index 00000000..c161476d
--- /dev/null
+++ b/tests/handlebars-whitespace/table.hbs
@@ -0,0 +1,20 @@
+
{{title}}
+