Repository: prettier/prettier (JavaScript)

Issue:
Angular block syntax + prettier-ignore prints extra closing brace
**Prettier 3.1.1**
[Playground link](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeAhAWkwAgA4BOcMMAlnAZqQOZQRE7YB8AOlAAKkBmOAFJFAAmpMtACUOYGxw4AYhAhsAvjnZwANgGc4k6TgDyMABYVlIADQgIeUVE3JQAQwIEIAdwAKzhPZSP1bo4AnvaWAEYEjmAA1sQAyo4AtnAAMqRQcMhc-trhkTHxeFHp1MgwBACucJbaiaRlldUgcAAeeBSkybD+ACoUUM7kvtlaTZol6nAAihUQ8Fk5TQBWmi1xE9Oz80gjuSAAjltwHq54viCOmpgZcIK3FiDljqTqJQDCEImJjsgX6uoPcZQaiTACCJAIpDCFXgHgoaQyC1GliMMES6gA6kYRHBNEUwHA4j4RKQAG4iIK-MCaUIgUlVACSQgQMDiYEhNlBQjiMCCkyRe0IEG0GMieF+hFxFFJmUs6W0BBgJ0c1G+AqaRQICt+jmBFXUzgehHSMAxpEExmQAA4AAyWIiHUhEZWqn47RaWGCOMJmi1GZAAJksFW0PW9ww9zUSYVud0EKV11AqKrg8gI3xIJR1MIgICUSiAA)
<!-- prettier-ignore -->
```sh
--parser angular
```

**Input:**
<!-- prettier-ignore -->
```html
<!-- prettier-ignore -->
@if (condition) {
  Foo
} @else {
  Other
}
```

**Output:**
<!-- prettier-ignore -->
```html
<!-- prettier-ignore -->
@if (condition) {
  Foo
}
} @else {
  Other
}

```

**Expected behavior:**
For the extra brace not to be printed:
<!-- prettier-ignore -->
```html
<!-- prettier-ignore -->
@if (condition) {
  Foo
} @else {
  Other
}

```




Hints:

Patch:
diff --git a/src/language-html/print/angular-control-flow-block.js b/src/language-html/print/angular-control-flow-block.js
--- a/src/language-html/print/angular-control-flow-block.js
+++ b/src/language-html/print/angular-control-flow-block.js
@@ -6,6 +6,7 @@ import {
   line,
   softline,
 } from "../../document/builders.js";
+import { hasPrettierIgnore } from "../utils/index.js";
 import ANGULAR_CONTROL_FLOW_BLOCK_SETTINGS from "./angular-control-flow-block-settings.evaluate.js";
 import { printChildren } from "./children.js";
 
@@ -51,7 +52,8 @@ function isPreviousBlockUnClosed(path) {
   const { previous } = path;
   return (
     previous?.type === "angularControlFlowBlock" &&
-    !shouldCloseBlock(path.previous)
+    !hasPrettierIgnore(previous) &&
+    !shouldCloseBlock(previous)
   );
 }
 


Test patch:
diff --git a/tests/format/angular/control-flow/__snapshots__/jsfmt.spec.js.snap b/tests/format/angular/control-flow/__snapshots__/jsfmt.spec.js.snap
--- a/tests/format/angular/control-flow/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/format/angular/control-flow/__snapshots__/jsfmt.spec.js.snap
@@ -426,6 +426,48 @@ topStartToSideStartMaxSize) {
 ================================================================================
 `;
 
+exports[`ignore.html format 1`] = `
+====================================options=====================================
+parsers: ["angular"]
+printWidth: 80
+                                                                                | printWidth
+=====================================input======================================
+<!-- prettier-ignore -->
+@if (condition) {
+  Foo
+} @else {
+  Other
+}
+
+
+@if (condition) {
+  Foo
+}
+<!-- prettier-ignore -->
+@else {
+  Other
+}
+
+=====================================output=====================================
+<!-- prettier-ignore -->
+@if (condition) {
+  Foo
+}
+@else {
+  Other
+}
+
+@if (condition) {
+  Foo
+}
+<!-- prettier-ignore -->
+@else {
+  Other
+}
+
+================================================================================
+`;
+
 exports[`mix.html format 1`] = `
 ====================================options=====================================
 parsers: ["angular"]
diff --git a/tests/format/angular/control-flow/ignore.html b/tests/format/angular/control-flow/ignore.html
new file mode 100644
--- /dev/null
+++ b/tests/format/angular/control-flow/ignore.html
@@ -0,0 +1,15 @@
+<!-- prettier-ignore -->
+@if (condition) {
+  Foo
+} @else {
+  Other
+}
+
+
+@if (condition) {
+  Foo
+}
+<!-- prettier-ignore -->
+@else {
+  Other
+}