================================================================================
`;
diff --git a/tests/handlebars/element-node/element-node.hbs b/tests/handlebars/element-node/element-node.hbs
index 5564c99cc..0c12a8da0 100644
--- a/tests/handlebars/element-node/element-node.hbs
+++ b/tests/handlebars/element-node/element-node.hbs
@@ -34,3 +34,5 @@
diff --git a/tests/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap
index 5168494e5..5cb12c015 100644
--- a/tests/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/handlebars/html-whitespace-sensitivity/__snapshots__/jsfmt.spec.js.snap
@@ -433,125 +433,118 @@ sometimes{{nogaps}}areimportant
=====================================output=====================================
-
{{#component propA}}
- for {{propB}} do {{propC}} f
+ for
+ {{propB}}
+ do
+ {{propC}}
+ f
{{/component}}
{{#component propA}}
- for {{propB}}
-
do
+ {{propC}}
+ f
{{/component}}
-{{propA}} {{propB}}
+{{propA}}
+{{propB}}
{{propC}}{{propD}}
-
{{name}}
-Some sentence with {{dynamic
-}} expressions.
+Some sentence with
+{{dynamic}}
+expressions.
sometimes{{nogaps
-}}areimportant
-
-{{name}} is your name
+{{name}}
+is your name
{{#block}}{{/block}}
{{#block}}
- some {{text}}
+ some
+ {{text}}
{{/block}}
{{#block}}
- some {{text}}
+
+ some
+ {{text}}
{{/block}}
123
@@ -560,49 +553,23 @@ sometimes{{nogaps
- |
- A
- |
-
- B
- |
-
- C
- |
+ A |
+ B |
+ C |
-
-
-
- |
- A
- |
-
- B
- |
-
- C
- |
-
-
-
+
- |
- A
- |
-
-
- B
- |
-
-
- C
- |
+ A |
+ B |
+ C |
@@ -613,5 +580,164 @@ sometimes{{nogaps
+
+================================================================================
+`;
+
+exports[`snippet: #12 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+=====================================output=====================================
+
+================================================================================
+`;
+
+exports[`snippet: #13 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+=====================================output=====================================
+
+================================================================================
+`;
+
+exports[`snippet: #14 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+=====================================output=====================================
+
+================================================================================
+`;
+
+exports[`snippet: #15 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+=====================================output=====================================
+
+================================================================================
+`;
+
+exports[`snippet: #16 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
![]()
+=====================================output=====================================
+
![]()
+================================================================================
+`;
+
+exports[`snippet: #17 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
![]()
+=====================================output=====================================
+
![]()
+================================================================================
+`;
+
+exports[`snippet: #18 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
![]()
+=====================================output=====================================
+
![]()
+================================================================================
+`;
+
+exports[`snippet: #19 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
![]()
+=====================================output=====================================
+
![]()
+================================================================================
+`;
+
+exports[`snippet: #20 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
|
+=====================================output=====================================
+
|
+================================================================================
+`;
+
+exports[`snippet: #21 - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
X or Y
X or Y
+=====================================output=====================================
+
X
+ or
+ Y
X or Y
+================================================================================
+`;
+
+exports[`snippet: \`U+2005\` should format like \`U+005F\` not like \`U+0020\` - {"htmlWhitespaceSensitivity":"strict","printWidth":40} format 1`] = `
+====================================options=====================================
+htmlWhitespaceSensitivity: "strict"
+parsers: ["glimmer"]
+printWidth: 40
+ | printWidth
+=====================================input======================================
+
+
before afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before_afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+=====================================output=====================================
+
+
before afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before_afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before
+ afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
================================================================================
`;
diff --git a/tests/handlebars/html-whitespace-sensitivity/jsfmt.spec.js b/tests/handlebars/html-whitespace-sensitivity/jsfmt.spec.js
index eecdb7268..07299457f 100644
--- a/tests/handlebars/html-whitespace-sensitivity/jsfmt.spec.js
+++ b/tests/handlebars/html-whitespace-sensitivity/jsfmt.spec.js
@@ -1,8 +1,85 @@
+const { outdent } = require("outdent");
+
run_spec(__dirname, ["glimmer"], {
htmlWhitespaceSensitivity: "ignore",
printWidth: 40,
});
-run_spec(__dirname, ["glimmer"], {
- htmlWhitespaceSensitivity: "strict",
- printWidth: 40,
-});
+run_spec(
+ {
+ dirname: __dirname,
+ snippets: [
+ // single
+ // https://developer.mozilla.org/en-US/docs/Glossary/Whitespace#In_HTML
+ ...["\u0009", "\u000C", "\u0020"].map((textContent) => ({
+ code: `
${textContent}
`,
+ name: "content",
+ output: "
",
+ })),
+ ...["\u000A", "\u000D"].map((textContent) => ({
+ code: `
${textContent}
`,
+ name: "content",
+ output: "
\n
",
+ })),
+
+ // many
+ {
+ code: "
\u0009\u000A\u000C\u000D\u0020
",
+ output: "
\n\n
",
+ },
+
+ // single
+ ...["\u0009", "\u000C", "\u0020"].map((textContent) => ({
+ code: `
![]()
${textContent}
![]()
`,
+ name: "between",
+ output: "
![]()
",
+ })),
+ ...["\u000A", "\u000D"].map((textContent) => ({
+ code: `
![]()
${textContent}
![]()
`,
+ name: "between",
+ output: "
![]()
\n
![]()
",
+ })),
+
+ // many
+ {
+ code: "
![]()
\u0009\u000A\u000C\u000D\u0020
![]()
",
+ output: "
![]()
\n\n
![]()
",
+ },
+
+ // non-space
+ ...[
+ "\u2005",
+ " \u2005 ",
+ " \u2005\u2005 ",
+ " \u2005 \u2005 ",
+ ].map((textContent) => `
${textContent}
`),
+
+ ...[
+ "\u2005",
+ " \u2005 ",
+ " \u2005\u2005 ",
+ " \u2005 \u2005 ",
+ ].map((textContent) => `
![]()
${textContent}
![]()
`),
+
+ "
\u2005 | \u2005
",
+
+ "
X \u2005 or \u2005 Y
X \u2005 or \u2005 Y
",
+
+ {
+ name: "`U+2005` should format like `U+005F` not like `U+0020`",
+ code: outdent`
+
+
before\u2005afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before\u005Fafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+
+
before\u0020afterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafterafter
+ `,
+ },
+ ],
+ },
+ ["glimmer"],
+ {
+ htmlWhitespaceSensitivity: "strict",
+ printWidth: 40,
+ }
+);
diff --git a/tests/html/attributes/__snapshots__/jsfmt.spec.js.snap b/tests/html/attributes/__snapshots__/jsfmt.spec.js.snap
index 2e5de09d6..9dc2e0790 100644
--- a/tests/html/attributes/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/html/attributes/__snapshots__/jsfmt.spec.js.snap
@@ -234,6 +234,179 @@ printWidth: 80
================================================================================
`;
+exports[`class-bem1.html format 1`] = `
+====================================options=====================================
+parsers: ["html"]
+printWidth: 80
+ | printWidth
+=====================================input======================================
+
Foo
+
+
+
+=====================================output=====================================
+
+ Foo
+
+
+
+
+================================================================================
+`;
+
+exports[`class-bem2.html format 1`] = `
+====================================options=====================================
+parsers: ["html"]
+printWidth: 80
+ | printWidth
+=====================================input======================================
+
+
+=====================================output=====================================
+
+
+================================================================================
+`;
+
+exports[`class-leading-dashes.html format 1`] = `
+====================================options=====================================
+parsers: ["html"]
+printWidth: 80
+ | printWidth
+=====================================input======================================
+
+
+
+
+=====================================output=====================================
+
+
+
+
+================================================================================
+`;
+
+exports[`class-many-short-names.html format 1`] = `
+====================================options=====================================
+parsers: ["html"]
+printWidth: 80
+ | printWidth
+=====================================input======================================
+
+ Jump to
+ x
+
+
+=====================================output=====================================
+
+ Jump to
+ x
+
+
+================================================================================
+`;
+
exports[`class-names.html format 1`] = `
====================================options=====================================
parsers: ["html"]
@@ -296,11 +469,41 @@ width="205px" alt="Yahoo"/>