diff --git a/changelog_unreleased/html/pr-5959 b/changelog_unreleased/html/pr-5959
new file mode 100644
index 000000000..a55167123
--- /dev/null
+++ b/changelog_unreleased/html/pr-5959
@@ -0,0 +1,24 @@
+#### Comments in `pre` tags caused bad formatting of following closing tag ([#5959](https://github.com/prettier/prettier/pull/5959) by [@selvazhagan](https://github.com/selvazhagan))
+
+
+```
+
+
+
+
+
+
+
+
+
++
+ ++
-------------------------------------------------------------------------------- @@ -896,6 +905,17 @@ ___________________________+++ +++++ ================================================================================ `; @@ -986,6 +1006,15 @@ ___________________________+ +++++ +++ =====================================output=====================================+ ++-------------------------------------------------------------------------------- @@ -1100,6 +1129,17 @@ ___________________________+++ +++++ ================================================================================ `; @@ -1189,6 +1229,15 @@ ___________________________+ +++++ +++ =====================================output=====================================+ ++-------------------------------------------------------------------------------- @@ -1271,6 +1320,17 @@ ___________________________+++ +++++ ================================================================================ `; @@ -1362,6 +1422,15 @@ ___________________________+ +++++ +++ =====================================output=====================================+ ++-------------------------------------------------------------------------------- @@ -1452,6 +1521,17 @@ ___________________________+++ +++++ ================================================================================ `; @@ -1543,6 +1623,15 @@ ___________________________+ +++++ +++ =====================================output=====================================+ ++-------------------------------------------------------------------------------- @@ -1633,6 +1722,17 @@ ___________________________+++ +++++ ================================================================================ `; diff --git a/tests/html_tags/pre.html b/tests/html_tags/pre.html index 6307de469..05b61de54 100644 --- a/tests/html_tags/pre.html +++ b/tests/html_tags/pre.html @@ -78,3 +78,12 @@ ___________________________+ +++ +++ +++ ++