@@ -106,15 +106,12 @@ function shouldPrePrintDoubleHardline(path, options) {
106106 ( node . type === "list" || ! path . callParent ( isLooseListItem ) ) ;
107107 }
108108 const isPrevNodePrettierIgnore = isPrettierIgnore ( previous ) === "next" ;
109- const isBlockHtmlWithoutBlankLineBetweenPrevHtml =
109+ const isBlockHtmlWithoutBlankLineBetweenPrevNode =
110110 node . type === "html" &&
111- previous . type === "html" &&
112- previous . position . end . line + 1 === node . position . start . line ;
113- const isBlockHtmlWithoutBlankLineBetweenPrevParagraph =
114- options . parser !== "mdx" &&
115- node . type === "html" &&
116- previous . type === "paragraph" &&
111+ previous &&
117112 previous . position . end . line + 1 === node . position . start . line ;
113+ const isBlockHtmlWithoutBlankLineBetweenPrevHtml =
114+ previous . type === "html" && isBlockHtmlWithoutBlankLineBetweenPrevNode ;
118115 const isHtmlDirectAfterListItem =
119116 node . type === "html" &&
120117 parent . type === "listItem" &&
@@ -125,8 +122,9 @@ function shouldPrePrintDoubleHardline(path, options) {
125122 isSiblingNode ||
126123 isInTightListItem ||
127124 isPrevNodePrettierIgnore ||
128- isBlockHtmlWithoutBlankLineBetweenPrevHtml ||
129- isBlockHtmlWithoutBlankLineBetweenPrevParagraph ||
125+ ( options . parser === "mdx"
126+ ? isBlockHtmlWithoutBlankLineBetweenPrevHtml
127+ : isBlockHtmlWithoutBlankLineBetweenPrevNode ) ||
130128 isHtmlDirectAfterListItem
131129 ) ;
132130}
0 commit comments