diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index 5aa0bbd15ec6..4a25c82d4e9a 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -476,15 +476,17 @@ function printChildren(path, options, print) { group(printOpeningTag(childPath, options, print)), replaceNewlines( options.originalText.slice( - child.startSourceSpan.end.offset - + child.startSourceSpan.end.offset + (child.firstChild && needsToBorrowParentOpeningTagEndMarker(child.firstChild) - ? printOpeningTagEndMarker(child).length + ? -printOpeningTagEndMarker(child).length : 0), child.endSourceSpan.start.offset + (child.lastChild && needsToBorrowParentClosingTagStartMarker(child.lastChild) ? printClosingTagStartMarker(child).length + : needsToBorrowLastChildClosingTagEndMarker(child) + ? -printClosingTagEndMarker(child.lastChild).length : 0) ), literalline diff --git a/tests/html_tags/__snapshots__/jsfmt.spec.js.snap b/tests/html_tags/__snapshots__/jsfmt.spec.js.snap index 0115eee0fd53..4c67a0d9c0d9 100644 --- a/tests/html_tags/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_tags/__snapshots__/jsfmt.spec.js.snap @@ -647,6 +647,8 @@ ___________________________

+
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 --------------------------------------------------------------------------------
@@ -735,6 +737,8 @@ ___________________________
 
 

 
+
+ `; exports[`pre.html - html-verify 2`] = ` @@ -816,6 +820,8 @@ ___________________________

+
+
~
 --------------------------------------------------------------------------------
@@ -924,6 +930,8 @@ ___________________________
 
 

 
+
+ `; exports[`pre.html - html-verify 3`] = ` @@ -1005,6 +1013,8 @@ ___________________________

+
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 --------------------------------------------------------------------------------
@@ -1083,6 +1093,8 @@ ___________________________
 
 

 
+
+ `; exports[`pre.html - html-verify 4`] = ` @@ -1164,6 +1176,8 @@ ___________________________

+
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 --------------------------------------------------------------------------------
@@ -1252,6 +1266,8 @@ ___________________________
 
 

 
+
+ `; exports[`pre.html - html-verify 5`] = ` @@ -1333,6 +1349,8 @@ ___________________________

+
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 --------------------------------------------------------------------------------
@@ -1421,6 +1439,8 @@ ___________________________
 
 

 
+
+ `; exports[`tags.html - html-verify 1`] = ` diff --git a/tests/html_tags/pre.html b/tests/html_tags/pre.html index 6e36211ba153..6307de4695da 100644 --- a/tests/html_tags/pre.html +++ b/tests/html_tags/pre.html @@ -76,3 +76,5 @@

+
+