Fix ignored element print (#7867)

* Fix ignored element print

* Add changelog
This commit is contained in:
fisker Cheung authored and GitHub committed 2020-03-25 15:54:39 +03:00
1 parent 2fc35d2862
commit 77e3fc0d41
4 files changed
+31 -9

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#### Fix ignored empty inline element print ([#7867](https://github.com/prettier/prettier/pull/7867) by [@fisker](https://github.com/fisker))
<!-- prettier-ignore -->
```html
<!--Input-->
<!--prettier-ignore--><span></span>
<!--prettier-ignore--><span>_</span>
<!--Prettier stable-->
<!--prettier-ignore--><span
></span>
<!--prettier-ignore--><span>_</span>
<!--Prettier stable (Second format)-->
<!--prettier-ignore--><span
></span>
<!--prettier-ignore--><span>_</span>
<!--Prettier master-->
<!--prettier-ignore--><span></span>
<!--prettier-ignore--><span>_</span>
```
+7 -6
View File
@@ -554,12 +554,13 @@ function printChildren(path, options, print) {
? hardline
: softline
: (needsToBorrowNextOpeningTagStartMarker(prevNode) &&
/**
* 123<a
* ~
* ><b>
*/
(nextNode.firstChild ||
(hasPrettierIgnore(nextNode) ||
/**
* 123<a
* ~
* ><b>
*/
nextNode.firstChild ||
/**
* 123<!--
* ~
@@ -14,8 +14,7 @@ printWidth: 80
123<!--prettier-ignore-->456
<span></span
><!--prettier-ignore--><span
></span>
><!--prettier-ignore--><span></span>
================================================================================
`;
-1
View File
@@ -34,7 +34,6 @@ const unstableTests = new Map(
"html_angular/attributes.component.html",
(options) => options.printWidth === 1,
],
"html_prettier_ignore/cases.html",
"js_empty/semicolon.js",
"jsx_ignore/jsx_ignore.js",
"markdown_footnoteDefinition/multiline.md",