aboutsummaryrefslogtreecommitdiff
path: root/integration/snippets/jsx-spacing.jsx
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-03 19:29:07 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-03 19:29:07 -0700
commit303a5ea898cd1df71a00caabd326c74940b379fc (patch)
treedbeab694673c7e47be28b4f6a0f19f94d0ae395e /integration/snippets/jsx-spacing.jsx
parentd502d0bcd6c2f908ffba1cbba149c3f833764f6f (diff)
downloadbun-303a5ea898cd1df71a00caabd326c74940b379fc.tar.gz
bun-303a5ea898cd1df71a00caabd326c74940b379fc.tar.zst
bun-303a5ea898cd1df71a00caabd326c74940b379fc.zip
[JSX] Fix regression with JSX entities
Diffstat (limited to 'integration/snippets/jsx-spacing.jsx')
-rw-r--r--integration/snippets/jsx-spacing.jsx36
1 files changed, 36 insertions, 0 deletions
diff --git a/integration/snippets/jsx-spacing.jsx b/integration/snippets/jsx-spacing.jsx
new file mode 100644
index 000000000..73e31ebaa
--- /dev/null
+++ b/integration/snippets/jsx-spacing.jsx
@@ -0,0 +1,36 @@
+import * as ReactDOM from "react-dom/server";
+
+const Tester = ({ description }) => {
+ console.assert(
+ description ===
+ "foo\nbar \n\nbaz\n\nthis\ntest\n\nchecks\nnewlines\nare\ngood\nyeah\n\n",
+ "Expected description to be 'foo\\nbar \\n\\nbaz\\n\\nthis\\ntest\\n\\nchecks\\nnewlines\\nare\\ngood\\nyeah\\n\\n' but was '" +
+ description +
+ "'"
+ );
+
+ return description;
+};
+
+export function test() {
+ const foo = ReactDOM.renderToString(
+ <Tester
+ description="foo
+ bar
+
+ baz
+
+ this
+ test
+
+ checks
+ newlines
+ are
+ good
+ yeah
+
+ "
+ ></Tester>
+ );
+ testDone(import.meta.url);
+}