You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original code alerts 8, while the formatted code alerts 20. When parsing an HTML file, for elements that cannot be self-closed (like <script>) Prettier should not consider them as self-closed if they end with />.
This is related to #5246 and #15336, but those issue are about equivalent ways that Prettier could format code to, while this issue is about a parsing bug where Prettier changes the behavior of code.
The text was updated successfully, but these errors were encountered:
fisker
added
type:bug
Issues identifying ugly output, or a defect in the program
lang:html
Issues affecting HTML (and SVG but not JSX)
labels
Apr 4, 2024
Prettier 3.2.5
Playground link
# Options (if any): --parser=html
Input:
Output:
Expected output:
or
or throw an error
Why?
The original code alerts
8
, while the formatted code alerts20
. When parsing an HTML file, for elements that cannot be self-closed (like<script>
) Prettier should not consider them as self-closed if they end with/>
.This is related to #5246 and #15336, but those issue are about equivalent ways that Prettier could format code to, while this issue is about a parsing bug where Prettier changes the behavior of code.
The text was updated successfully, but these errors were encountered: