---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info:
test_file: js/multiparser-comments/comment-inside.js
---
# Input
```js
// #9274
html`
${this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */}
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`${
foo
/* comment */
}`;
graphql`
${
foo
/* comment */
}
`;
css`${
foo
/* comment */
}`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
${x(foo, // fg
bar
)}
`;
```
# Prettier differences
```diff
--- Prettier
+++ Rome
@@ -13,36 +13,32 @@
/* comment */
}`;
html`
- ${
- foo
- /* comment */
- }
+${
+ foo
+ /* comment */
+}
`;
+graphql`${
+ foo
+ /* comment */
+}`;
graphql`
- ${
- foo
- /* comment */
- }
-`;
-graphql`
- ${
- foo
- /* comment */
- }
+${
+ foo
+ /* comment */
+}
`;
-css`
- ${
- foo
- /* comment */
- }
-`;
+css`${
+ foo
+ /* comment */
+}`;
css`
- ${
- foo
- /* comment */
- }
+${
+ foo
+ /* comment */
+}
`;
markdown`${
@@ -62,6 +58,5 @@
${x(
foo, // fg
bar,
- )}
-
+ )}
`;
```
# Output
```js
// #9274
html`
${
this.set && this.set.artist
/* avoid console errors if `this.set` is undefined */
}
`;
html`${
foo
/* comment */
}`;
html`
${
foo
/* comment */
}
`;
graphql`${
foo
/* comment */
}`;
graphql`
${
foo
/* comment */
}
`;
css`${
foo
/* comment */
}`;
css`
${
foo
/* comment */
}
`;
markdown`${
foo
/* comment */
}`;
markdown`
${
foo
/* comment */
}
`;
// https://github.com/prettier/prettier/pull/9278#issuecomment-700589195
expr1 = html`
${x(
foo, // fg
bar,
)}
`;
```