diff --git a/src/language-html/options.js b/src/language-html/options.js index ee8d6c0592dc..44179df1ca1b 100644 --- a/src/language-html/options.js +++ b/src/language-html/options.js @@ -24,5 +24,28 @@ module.exports = { description: "Whitespaces are considered insensitive." } ] + }, + htmlTopLevelIndent: { + since: "1.18.0", + category: CATEGORY_HTML, + type: "choice", + default: "auto", + description: "How to handle top-level indent in HTML.", + choices: [ + { + value: "always", + description: + "Always apply top-level indent for templates, scripts and styles." + }, + { + value: "never", + description: "Avoid top-level indent for templates, scripts and styles." + }, + { + value: "auto", + description: + "Avoid top-level indent for scripts and styles inside Vue files." + } + ] } }; diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index ce5a8fab8f34..d586ebe81460 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -227,9 +227,11 @@ function genericPrint(path, options, print) { ? ifBreak(indent(childrenDoc), childrenDoc, { groupId: attrGroupId }) - : isScriptLikeTag(node) && - node.parent.type === "root" && - options.parser === "vue" + : node.parent.type === "root" && + ((options.htmlTopLevelIndent === "auto" && + isScriptLikeTag(node) && + options.parser === "vue") || + options.htmlTopLevelIndent === "never") ? childrenDoc : indent(childrenDoc))( concat([ diff --git a/tests/html_aurelia/__snapshots__/jsfmt.spec.js.snap b/tests/html_aurelia/__snapshots__/jsfmt.spec.js.snap index d08d4efdaa63..8b4f4cd8a86e 100644 --- a/tests/html_aurelia/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_aurelia/__snapshots__/jsfmt.spec.js.snap @@ -17,3 +17,60 @@ printWidth: 80 ================================================================================ `; + +exports[`basic.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`basic.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`basic.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; diff --git a/tests/html_aurelia/jsfmt.spec.js b/tests/html_aurelia/jsfmt.spec.js index 53763df9b20b..53078dba5fde 100644 --- a/tests/html_aurelia/jsfmt.spec.js +++ b/tests/html_aurelia/jsfmt.spec.js @@ -1 +1,4 @@ run_spec(__dirname, ["html"]); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "never" }); diff --git a/tests/html_css/__snapshots__/jsfmt.spec.js.snap b/tests/html_css/__snapshots__/jsfmt.spec.js.snap index 1effb3f87af8..6c2b1f48879a 100644 --- a/tests/html_css/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_css/__snapshots__/jsfmt.spec.js.snap @@ -14,6 +14,51 @@ printWidth: 80 ================================================================================ `; +exports[`empty.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`empty.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`empty.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + exports[`less.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -60,6 +105,147 @@ printWidth: 80 ================================================================================ `; +exports[`less.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`less.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`less.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + exports[`postcss.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -92,6 +278,105 @@ printWidth: 80 ================================================================================ `; +exports[`postcss.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`postcss.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`postcss.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + exports[`scss.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -168,14 +453,341 @@ printWidth: 80 ================================================================================ `; -exports[`simple.html 1`] = ` +exports[`scss.html 2`] = ` ====================================options===================================== +htmlTopLevelIndent: "auto" parsers: ["html"] printWidth: 80 | printWidth =====================================input====================================== - - + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + +exports[`scss.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + +exports[`scss.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + +exports[`simple.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +=====================================output===================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + +exports[`simple.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +=====================================output===================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + +exports[`simple.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + Sample styled page @@ -215,6 +827,54 @@ printWidth: 80 ================================================================================ `; +exports[`simple.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +=====================================output===================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + exports[`single-style.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -246,3 +906,102 @@ printWidth: 80 ================================================================================ `; + +exports[`single-style.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`single-style.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`single-style.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; diff --git a/tests/html_css/jsfmt.spec.js b/tests/html_css/jsfmt.spec.js index 53763df9b20b..53078dba5fde 100644 --- a/tests/html_css/jsfmt.spec.js +++ b/tests/html_css/jsfmt.spec.js @@ -1 +1,4 @@ run_spec(__dirname, ["html"]); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "never" }); diff --git a/tests/html_js/__snapshots__/jsfmt.spec.js.snap b/tests/html_js/__snapshots__/jsfmt.spec.js.snap index 66ca2ccdf9cc..004c7e677679 100644 --- a/tests/html_js/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_js/__snapshots__/jsfmt.spec.js.snap @@ -14,6 +14,51 @@ printWidth: 80 ================================================================================ `; +exports[`empty.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`empty.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`empty.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + exports[`js.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -74,6 +119,189 @@ printWidth: 80 ================================================================================ `; +exports[`js.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + +exports[`js.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + +exports[`js.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + +=====================================output===================================== + + + + + + +================================================================================ +`; + exports[`simple.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -120,93 +348,858 @@ printWidth: 80 ================================================================================ `; -exports[`single-script.html 1`] = ` +exports[`simple.html 2`] = ` ====================================options===================================== +htmlTopLevelIndent: "auto" parsers: ["html"] printWidth: 80 | printWidth =====================================input====================================== - - + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + =====================================output===================================== - - + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + +exports[`simple.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +=====================================output===================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + +exports[`simple.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +=====================================output===================================== + + + + Sample styled page + + + + +

Sample styled page

+

This page is just a demo.

+ + + +================================================================================ +`; + +exports[`single-script.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`single-script.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`single-script.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`single-script.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`something-else.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`something-else.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`something-else.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`something-else.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`template-literal.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + + + + +=====================================output===================================== + + + + + + + + +================================================================================ +`; + +exports[`template-literal.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + + + + +=====================================output===================================== + + + + + + + + +================================================================================ +`; + +exports[`template-literal.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + + + + +=====================================output===================================== + + + + + + + + +================================================================================ +`; + +exports[`template-literal.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + + + + + + +=====================================output===================================== + + + + + + + + +================================================================================ +`; + +exports[`typescript.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`typescript.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + -================================================================================ -`; +=====================================output===================================== + + interface Person { + firstName: string; + lastName: string; + } -=====================================output===================================== - + - - + function greeter(person: Person) { + return "Hello, " + person.firstName + " " + person.lastName; + } -=====================================output===================================== - - - - - - - + let user = new Student("Jane", "M.", "User"); + + document.body.innerHTML = greeter(user); + + ================================================================================ `; -exports[`typescript.html 1`] = ` +exports[`typescript.html 3`] = ` ====================================options===================================== +htmlTopLevelIndent: "always" parsers: ["html"] printWidth: 80 | printWidth @@ -383,3 +1376,183 @@ printWidth: 80 ================================================================================ `; + +exports[`typescript.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + +=====================================output===================================== + + + + +================================================================================ +`; diff --git a/tests/html_js/jsfmt.spec.js b/tests/html_js/jsfmt.spec.js index 53763df9b20b..53078dba5fde 100644 --- a/tests/html_js/jsfmt.spec.js +++ b/tests/html_js/jsfmt.spec.js @@ -1 +1,4 @@ run_spec(__dirname, ["html"]); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "never" }); diff --git a/tests/html_lwc/__snapshots__/jsfmt.spec.js.snap b/tests/html_lwc/__snapshots__/jsfmt.spec.js.snap index 63197acfbc90..d12f1aa34b10 100644 --- a/tests/html_lwc/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_lwc/__snapshots__/jsfmt.spec.js.snap @@ -115,3 +115,120 @@ semi: false ================================================================================ `; + +exports[`attributes.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parser: "lwc" +parsers: ["lwc"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`attributes.html 5`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parser: "lwc" +parsers: ["lwc"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + + +================================================================================ +`; + +exports[`attributes.html 6`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parser: "lwc" +parsers: ["lwc"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + + +================================================================================ +`; diff --git a/tests/html_lwc/jsfmt.spec.js b/tests/html_lwc/jsfmt.spec.js index 8286bbff48fb..902b20e78000 100644 --- a/tests/html_lwc/jsfmt.spec.js +++ b/tests/html_lwc/jsfmt.spec.js @@ -1,3 +1,6 @@ run_spec(__dirname, ["lwc"], { parser: "lwc" }); run_spec(__dirname, ["lwc"], { parser: "lwc", trailingComma: "es5" }); run_spec(__dirname, ["lwc"], { parser: "lwc", semi: false }); +run_spec(__dirname, ["lwc"], { parser: "lwc", htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["lwc"], { parser: "lwc", htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["lwc"], { parser: "lwc", htmlTopLevelIndent: "never" }); diff --git a/tests/html_script/__snapshots__/jsfmt.spec.js.snap b/tests/html_script/__snapshots__/jsfmt.spec.js.snap index 18a5cad25c06..8c39fca150a0 100644 --- a/tests/html_script/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_script/__snapshots__/jsfmt.spec.js.snap @@ -17,3 +17,60 @@ printWidth: 80 ================================================================================ `; + +exports[`script.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`script.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; + +exports[`script.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; diff --git a/tests/html_script/jsfmt.spec.js b/tests/html_script/jsfmt.spec.js index 53763df9b20b..53078dba5fde 100644 --- a/tests/html_script/jsfmt.spec.js +++ b/tests/html_script/jsfmt.spec.js @@ -1 +1,4 @@ run_spec(__dirname, ["html"]); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "never" }); diff --git a/tests/html_svg/__snapshots__/jsfmt.spec.js.snap b/tests/html_svg/__snapshots__/jsfmt.spec.js.snap index 48ba45e0c86c..9a45fc107dc3 100644 --- a/tests/html_svg/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_svg/__snapshots__/jsfmt.spec.js.snap @@ -111,3 +111,342 @@ printWidth: 80 ================================================================================ `; + +exports[`svg.html 2`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + SVG + + + + + + + + + + + + + + Text + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +=====================================output===================================== + + + + SVG + + + + + + + + + + + + + + + + Text + + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +================================================================================ +`; + +exports[`svg.html 3`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + SVG + + + + + + + + + + + + + + Text + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +=====================================output===================================== + + + + SVG + + + + + + + + + + + + + + + + Text + + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +================================================================================ +`; + +exports[`svg.html 4`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + + SVG + + + + + + + + + + + + + + Text + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +=====================================output===================================== + + + + SVG + + + + + + + + + + + + + + + + Text + + + + + + +
+

+ 123 +

+ + 123 + +
+
+
+ +================================================================================ +`; diff --git a/tests/html_svg/jsfmt.spec.js b/tests/html_svg/jsfmt.spec.js index 53763df9b20b..53078dba5fde 100644 --- a/tests/html_svg/jsfmt.spec.js +++ b/tests/html_svg/jsfmt.spec.js @@ -1 +1,4 @@ run_spec(__dirname, ["html"]); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "auto" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "always" }); +run_spec(__dirname, ["html"], { htmlTopLevelIndent: "never" }); diff --git a/tests/html_tags/__snapshots__/jsfmt.spec.js.snap b/tests/html_tags/__snapshots__/jsfmt.spec.js.snap index 41f028cc18f9..fc57cbd0352e 100644 --- a/tests/html_tags/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_tags/__snapshots__/jsfmt.spec.js.snap @@ -75,6 +75,51 @@ printWidth: 80 ================================================================================ `; +exports[`case-sensitive.html 6`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +hello world + +=====================================output===================================== +hello world + +================================================================================ +`; + +exports[`case-sensitive.html 7`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +hello world + +=====================================output===================================== +hello world + +================================================================================ +`; + +exports[`case-sensitive.html 8`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +hello world + +=====================================output===================================== +hello world + +================================================================================ +`; + exports[`closing-at-start.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -283,6 +328,135 @@ printWidth: 80 ================================================================================ `; +exports[`closing-at-start.html 6`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+ aaaaaaaaaa + bbbbbbbbbb + cccccccccc +
+
+ aaaaaaaaaa + bbbbbbbbbbcccccccccc +
+ +=====================================output===================================== +
+ aaaaaaaaaa + bbbbbbbbbb + cccccccccc +
+
+ aaaaaaaaaa + bbbbbbbbbbcccccccccc +
+ +================================================================================ +`; + +exports[`closing-at-start.html 7`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+ aaaaaaaaaa + bbbbbbbbbb + cccccccccc +
+
+ aaaaaaaaaa + bbbbbbbbbbcccccccccc +
+ +=====================================output===================================== +
+ aaaaaaaaaa + bbbbbbbbbb + cccccccccc +
+
+ aaaaaaaaaa + bbbbbbbbbbcccccccccc +
+ +================================================================================ +`; + +exports[`closing-at-start.html 8`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+ aaaaaaaaaa + bbbbbbbbbb + cccccccccc +
+
+ aaaaaaaaaa + bbbbbbbbbbcccccccccc +
+ +=====================================output===================================== +
+aaaaaaaaaa +bbbbbbbbbb +cccccccccc +
+
+aaaaaaaaaa +bbbbbbbbbbcccccccccc +
+ +================================================================================ +`; + exports[`custom-element.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -364,6 +538,57 @@ printWidth: 80 ================================================================================ `; +exports[`custom-element.html 6`] = ` +====================================options===================================== +htmlTopLevelIndent: "auto" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`custom-element.html 7`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + +exports[`custom-element.html 8`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + + +=====================================output===================================== + + + +================================================================================ +`; + exports[`openging-at-end.html 1`] = ` ====================================options===================================== parsers: ["html"] @@ -719,41 +944,233 @@ printWidth: 80 ================================================================================ `; -exports[`pre.html 1`] = ` +exports[`openging-at-end.html 6`] = ` ====================================options===================================== +htmlTopLevelIndent: "auto" parsers: ["html"] printWidth: 80 | printWidth =====================================input====================================== -
---------------------------------------------------------------------------------
-
+

Want to write us a letter? Use ourmailing address.

- * * * - ** ** *** - ** ** * - **** *** **** ******** ******** *** **** - * *** * **** **** * *** ******** ******** *** *** **** **** * - * **** ** **** * *** ** ** *** * *** ** **** -** ** ** * *** ** ** ** * *** ** -** ** ** ** *** ** ** ** ** *** ** -** ** ** ******** ** ** ** ******** ** -** ** ** ******* ** ** ** ******* ** -** ** ** ** ** ** ** ** ** -******* *** **** * ** ** ** **** * *** -****** *** ******* ** ** *** * ******* *** -** ***** *** ***** -** -** - ** +

Want to write us a letter? Use ourmailing address.

--------------------------------------------------------------------------------- -
-
+

Want to write us a letter? Use ourmailing address.

- Text in a pre element +=====================================output===================================== +

+ Want to write us a letter? Use ourmailing address. +

- is displayed in a fixed-width +

+ Want to write us a letter? Use ourmailing address. +

+ +

+ Want to write us a letter? Use ourmailing address. +

+ +================================================================================ +`; + +exports[`openging-at-end.html 7`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +

Want to write us a letter? Use ourmailing address.

+ +

Want to write us a letter? Use ourmailing address.

+ +

Want to write us a letter? Use ourmailing address.

+ +=====================================output===================================== +

+ Want to write us a letter? Use ourmailing address. +

+ +

+ Want to write us a letter? Use ourmailing address. +

+ +

+ Want to write us a letter? Use ourmailing address. +

+ +================================================================================ +`; + +exports[`openging-at-end.html 8`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +

Want to write us a letter? Use ourmailing address.

+ +

Want to write us a letter? Use ourmailing address.

+ +

Want to write us a letter? Use ourmailing address.

+ +=====================================output===================================== +

+Want to write us a letter? Use ourmailing address. +

+ +

+Want to write us a letter? Use ourmailing address. +

+ +

+Want to write us a letter? Use ourmailing address. +

+ +================================================================================ +`; + +exports[`pre.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
 
    font, and it preserves
 
@@ -1636,78 +2053,1685 @@ ___________________________
 ================================================================================
 `;
 
-exports[`tags.html 1`] = `
+exports[`pre.html 6`] = `
 ====================================options=====================================
+htmlTopLevelIndent: "auto"
 parsers: ["html"]
 printWidth: 80
                                                                                 | printWidth
 =====================================input======================================
-
-
-
-
-
-
-
-
-
-
-
-
string
-
very very very very very very very very very very very very very very very very long string
-
string
-
string
-
string
-
very very very very very very very very very very very very very very very very long string
-
string
-
very very very very very very very very very very very very very very very very long string
- -
string
-
string
string
-
string
string
-
string
string
-
-
-
string
-
-
string
-
-
+
+--------------------------------------------------------------------------------
 
-  
string
-
-
+ * * * + ** ** *** + ** ** * + **** *** **** ******** ******** *** **** + * *** * **** **** * *** ******** ******** *** *** **** **** * + * **** ** **** * *** ** ** *** * *** ** **** +** ** ** * *** ** ** ** * *** ** +** ** ** ** *** ** ** ** ** *** ** +** ** ** ******** ** ** ** ******** ** +** ** ** ******* ** ** ** ******* ** +** ** ** ** ** ** ** ** ** +******* *** **** * ** ** ** **** * *** +****** *** ******* ** ** *** * ******* *** +** ***** *** ***** +** +** + ** -
string
+-------------------------------------------------------------------------------- +
+
 
-  
string
+ Text in a pre element - - -*200 -123 -
123456
-

x

-

x

-

x

- + is displayed in a fixed-width + + font, and it preserves + + both spaces and + + line breaks + +
+
     Foo     Bar     
+
+     Foo     Bar
+
+
Foo     Bar
+
+
+     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +=====================================output===================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
+
+   font, and it preserves
+
+   both             spaces and
+
+   line breaks
+
+
+
     Foo     Bar     
+
+     Foo     Bar
+
+
+Foo     Bar
+
+
     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using + preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +================================================================================ +`; + +exports[`pre.html 7`] = ` +====================================options===================================== +htmlTopLevelIndent: "always" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
+
+   font, and it preserves
+
+   both             spaces and
+
+   line breaks
+
+
+
     Foo     Bar     
+
+     Foo     Bar
+
+
Foo     Bar
+
+
+     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +=====================================output===================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
+
+   font, and it preserves
+
+   both             spaces and
+
+   line breaks
+
+
+
     Foo     Bar     
+
+     Foo     Bar
+
+
+Foo     Bar
+
+
     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using + preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +================================================================================ +`; + +exports[`pre.html 8`] = ` +====================================options===================================== +htmlTopLevelIndent: "never" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
+
+   font, and it preserves
+
+   both             spaces and
+
+   line breaks
+
+
+
     Foo     Bar     
+
+     Foo     Bar
+
+
Foo     Bar
+
+
+     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +=====================================output===================================== +
+--------------------------------------------------------------------------------
+
+
+                                      *         *       *
+                                     **        **      ***
+                                     **        **       *
+   ****    ***  ****               ********  ********                   ***  ****
+  * ***  *  **** **** *    ***    ********  ********  ***        ***     **** **** *
+ *   ****    **   ****    * ***      **        **      ***      * ***     **   ****
+**    **     **          *   ***     **        **       **     *   ***    **
+**    **     **         **    ***    **        **       **    **    ***   **
+**    **     **         ********     **        **       **    ********    **
+**    **     **         *******      **        **       **    *******     **
+**    **     **         **           **        **       **    **          **
+*******      ***        ****    *    **        **       **    ****    *   ***
+******        ***        *******      **        **      *** *  *******     ***
+**                        *****                          ***    *****
+**
+**
+ **
+
+--------------------------------------------------------------------------------
+
+
+
+        Text in a pre element
+
+    is displayed in a fixed-width
+
+   font, and it preserves
+
+   both             spaces and
+
+   line breaks
+
+
+
     Foo     Bar     
+
+     Foo     Bar
+
+
+Foo     Bar
+
+
     Foo     Bar
+
+
+___________________________
+< I'm an expert in my field. >
+---------------------------
+     \\   ^__^
+      \\  (oo)\\_______
+         (__)\\       )\\/\\
+             ||----w |
+             ||     ||
+___________________________
+  
+
+ A cow saying, "I'm an expert in my field." The cow is illustrated using + preformatted text characters. +
+
+
+     Foo     Bar
+
+
+
+
+
+
+          ______
+          STRING
+          ______
+        
+
+
+
+
+

+
+
+ +================================================================================ +`; + +exports[`tags.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+
+
+
+
+
+
+
+
+
+
+
string
+
very very very very very very very very very very very very very very very very long string
+
string
+
string
+
string
+
very very very very very very very very very very very very very very very very long string
+
string
+
very very very very very very very very very very very very very very very very long string
+ +
string
+
string
string
+
string
string
+
string
string
+
+
+
string
+
+
string
+
+
+ +
string
+ +
+
+ +
string
+ +
string
+ +
+ +*200 +123 +
123456
+

x

+

x

+

x

+ + + | + +
+

+ + +

+

+ + +

+

"" is the property bound title.

+
  • 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  • +
    + + + + + + + + + + + +
    +foreign tag name should not be lower cased +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + "seddoeiusmod". +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod. +
    + + + + + + +=====================================output===================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    + very very very very very very very very very very very very very very very + very long string +
    +
    + string +
    +
    + string +
    +
    + string +
    +
    + very very very very very very very very very very very very very very very + very long string +
    +
    + string +
    +
    + very very very very very very very very very very very very very very very + very long string +
    + +
    string
    +
    +
    string
    +
    string
    +
    +
    +
    string
    +
    string
    +
    +
    +
    string
    +
    string
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    +
    +
    +
    +
    +
    +
    string
    +
    +
    +
    string
    +
    +
    +
    string
    + +
    string
    +
    +
      + 123 +
    • First
    • + 456 +
    • Second
    • + 789 +
    +*200 +123 +
    123456
    +

    x

    +

    x

    +

    x

    + + + +| + +
    + +

    + + +

    + +

    + + +

    +

    "" is the property bound title.

    +
  • + 12345678901234567890123456789012345678901234567890123456789012345678901234567890 +
  • +
    + + + + + + + + + + + +
    +foreign tag name should not be lower cased +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + "seddoeiusmod". +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod. +
    + + + + + + +================================================================================ +`; + +exports[`tags.html 2`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 1 + | printWidth +=====================================input====================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    + +
    string
    +
    string
    string
    +
    string
    string
    +
    string
    string
    +
    +
    +
    string
    +
    +
    string
    +
    +
    + +
    string
    + +
    +
    + +
    string
    + +
    string
    + +
    +
      123
    • First
    • 456
    • Second
    • 789
    +*200 +123 +
    123456
    +

    x

    +

    x

    +

    x

    + + + | + +
    +

    + + +

    +

    + + +

    +

    "" is the property bound title.

    +
  • 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  • +
    + + + + + + + + + + + +
    +foreign tag name should not be lower cased +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + "seddoeiusmod". +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod. +
    + + + + + + +=====================================output===================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + string +
    +
    + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + long + string +
    +
    + string +
    +
    + string +
    +
    + string +
    +
    + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + long + string +
    +
    + string +
    +
    + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + very + long + string +
    + +
    +
    + string +
    +
    +
    +
    + string +
    +
    + string +
    +
    +
    +
    +
    + string +
    +
    +
    + string +
    +
    +
    +
    + string +
    +
    +
    + string +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + string +
    +
    +
    +
    +
    +
    +
    +
    +
    + string +
    +
    +
    +
    + string +
    +
    +
    +
    + string +
    + +
    + string +
    +
    +
      + 123 +
    • + First +
    • + 456 +
    • + Second +
    • + 789 +
    +*200 +123 +
    + 123456 +
    +

    + x +

    +

    + x +

    +

    + x +

    + + + +| + +
    + +

    + + +

    + +

    + + +

    +

    + "" + is + the + property + bound + title. +

    +
  • + 12345678901234567890123456789012345678901234567890123456789012345678901234567890 +
  • +
    + + + + + + + + + + + +
    +foreign + tag + name + should + not + be + lower + cased +
    + Lorem + ipsum + dolor + sit + amet, + consectetur + adipiscing + elit, + "seddoeiusmod". +
    +
    + Lorem + ipsum + dolor + sit + amet, + consectetur + adipiscing + elit, + seddoeiusmod. +
    + + + + + + +================================================================================ +`; + +exports[`tags.html 3`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: Infinity +=====================================input====================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    + +
    string
    +
    string
    string
    +
    string
    string
    +
    string
    string
    +
    +
    +
    string
    +
    +
    string
    +
    +
    + +
    string
    + +
    +
    + +
    string
    + +
    string
    + +
    +
      123
    • First
    • 456
    • Second
    • 789
    +*200 +123 +
    123456
    +

    x

    +

    x

    +

    x

    + + + | + +
    +

    + + +

    +

    + + +

    +

    "" is the property bound title.

    +
  • 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  • +
    + + + + + + + + + + + +
    +foreign tag name should not be lower cased +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + "seddoeiusmod". +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod. +
    + + + + + + +=====================================output===================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    + +
    string
    +
    +
    string
    +
    string
    +
    +
    +
    string
    +
    string
    +
    +
    +
    string
    +
    string
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    +
    +
    +
    +
    +
    +
    string
    +
    +
    +
    string
    +
    +
    +
    string
    + +
    string
    +
    +
      + 123 +
    • First
    • + 456 +
    • Second
    • + 789 +
    +*200 +123 +
    123456
    +

    x

    +

    x

    +

    x

    + + + | + +
    +

    + + +

    +

    + + +

    +

    "" is the property bound title.

    +
  • 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  • +
    + + + + + + + + + + + +
    +foreign tag name should not be lower cased +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, "seddoeiusmod". +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod. +
    + + + + + + +================================================================================ +`; + +exports[`tags.html 4`] = ` +====================================options===================================== +htmlWhitespaceSensitivity: "strict" +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    +
    string
    +
    very very very very very very very very very very very very very very very very long string
    + +
    string
    +
    string
    string
    +
    string
    string
    +
    string
    string
    +
    +
    +
    string
    +
    +
    string
    +
    +
    + +
    string
    + +
    +
    + +
    string
    + +
    string
    + +
    +
      123
    • First
    • 456
    • Second
    • 789
    +*200 +123 +
    123456
    +

    x

    +

    x

    +

    x

    + | @@ -1784,29 +3808,26 @@ printWidth: 80 attribute-f="value" />
    string
    -
    - very very very very very very very very very very very very very very very - very long string -
    +
    very very very very very very very very very very very very very very very + very long string
    string
    - string -
    string
    - string -
    string
    +
    very very very very very very very very very very very very very very very + very long string
    - string - -
    - very very very very very very very very very very very very very very very - very long string -
    string
    - string -
    very very very very very very very very very very very very very very very + very long string
    - very very very very very very very very very very very very very very very - very long string -
    string
    -
    -
    string
    -
    string
    -
    -
    -
    string
    -
    string
    -
    -
    -
    string
    -
    string
    -
    +
    string
    string
    +
    string
    string
    +
    string
    string
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    string
    -
    -
    -
    -
    -
    +
    +
    string
    string
    @@ -1873,20 +3885,18 @@ printWidth: 80
    string
    -
      - 123 -
    • First
    • - 456 -
    • Second
    • - 789 -
    +
      123
    • First
    • 456
    • Second
    • 789
    *200 123
    123456

    x

    -

    x

    +

    x

    x

    @@ -1899,21 +3909,21 @@ printWidth: 80

    - +



    - +

    "" is the property bound title.

    -
  • - 12345678901234567890123456789012345678901234567890123456789012345678901234567890 -
  • +
  • 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  • @@ -1945,11 +3955,12 @@ printWidth: 80 ================================================================================ `; -exports[`tags.html 2`] = ` +exports[`tags.html 5`] = ` ====================================options===================================== +htmlWhitespaceSensitivity: "ignore" parsers: ["html"] -printWidth: 1 - | printWidth +printWidth: 80 + | printWidth =====================================input======================================

    @@ -2072,18 +4083,12 @@ printWidth: 1


    -
    +

    -
    -
    +
    +

    @@ -2098,28 +4103,10 @@ printWidth: 1 attribute-e="value" attribute-f="value" /> +
    string
    - string -
    -
    - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - long - string + very very very very very very very very very very very very very very very + very long string
    string
    -
    - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - long - string +
    + very very very very very very very very very very very very very very very + very long string
    - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - very - long - string + very very very very very very very very very very very very very very very + very long string
    -
    -
    - string -
    +
    string
    -
    - string -
    +
    string
    -
    - string -
    +
    string
    -
    - string -
    +
    string
      123 -
    • - First -
    • +
    • First
    • 456 -
    • - Second -
    • +
    • Second
    • 789
    -*200 + + * + 200 + 123 +/> +123
    - 123456 + 123 + + 456

    - x + x +

    - x + x +

    - x + x +

    @@ -2341,47 +4233,29 @@ printWidth: 1 |
    - -

    + +
    +
    - -

    - -

    +
    +
    + +
    +
    - -

    +
    +

    - "" - is - the - property - bound + " + + " is the + property bound title.

  • @@ -2392,73 +4266,40 @@ printWidth: 1 - + - +
  • -foreign - tag - name - should - not - be - lower - cased +foreign tag name should not be lower cased
    - Lorem - ipsum - dolor - sit - amet, - consectetur - adipiscing - elit, - "seddoeiusmod". + Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + seddoeiusmod + ".
    - Lorem - ipsum - dolor - sit - amet, - consectetur - adipiscing - elit, - seddoeiusmod. + Lorem ipsum dolor sit amet, consectetur adipiscing elit, + seddoeiusmod + .
    - - - + + + ================================================================================ `; -exports[`tags.html 3`] = ` +exports[`tags.html 6`] = ` ====================================options===================================== +htmlTopLevelIndent: "auto" parsers: ["html"] -printWidth: Infinity +printWidth: 80 + | printWidth =====================================input======================================

    @@ -2582,20 +4423,70 @@ printWidth: Infinity


    -
    +


    -
    -
    -
    +
    +
    +
    string
    -
    very very very very very very very very very very very very very very very very long string
    -
    string
    -
    string
    -
    string
    -
    very very very very very very very very very very very very very very very very long string
    -
    string
    -
    very very very very very very very very very very very very very very very very long string
    +
    + very very very very very very very very very very very very very very very + very long string +
    +
    + string +
    +
    + string +
    +
    + string +
    +
    + very very very very very very very very very very very very very very very + very long string +
    +
    + string +
    +
    + very very very very very very very very very very very very very very very + very long string +