Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: format JSX Fragment correctly, consider Fragment as block #6398

Merged
merged 1 commit into from Nov 18, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,21 @@
#### MDX: fix JSX Fragment format incorrectly ([#6398](https://github.com/prettier/prettier/pull/6398) by [@JounQin](https://github.com/JounQin))

Previous versions format JSX Fragment incorrectly in mdx, this has been fixed in this version.

<!-- prettier-ignore -->
```md
<!-- Input -->
<>
test <World /> test
</> 123

<!-- Output (Prettier stable) -->
<>
test <World /> test
</> 123

<!-- Output (Prettier master) -->
<>
test <World /> test
</> 123
```
@@ -26,7 +26,7 @@

const IMPORT_REGEX = /^import\s/;
const EXPORT_REGEX = /^export\s/;
const BLOCKS_REGEX = "[a-z\\.]*(\\.){0,1}[a-z][a-z0-9\\.]*";
const BLOCKS_REGEX = "[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)*|";
const COMMENT_REGEX = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->";
const EMPTY_NEWLINE = "\n\n";

@@ -265,6 +265,12 @@ printWidth: 80

---

<>
test <World /> test
</> 123

---

| Column 1 | Column 2 |
|---|---|
| Text | <Hello>Text</Hello> |
@@ -299,6 +305,12 @@ printWidth: 80

---

<>
test <World /> test
</> 123

---

| Column 1 | Column 2 |
| -------- | ------------------- |
| Text | <Hello>Text</Hello> |
@@ -342,6 +354,12 @@ semi: false

---

<>
test <World /> test
</> 123

---

| Column 1 | Column 2 |
|---|---|
| Text | <Hello>Text</Hello> |
@@ -376,6 +394,12 @@ semi: false

---

<>
test <World /> test
</> 123

---

| Column 1 | Column 2 |
| -------- | ------------------- |
| Text | <Hello>Text</Hello> |
@@ -27,6 +27,12 @@

---

<>
test <World /> test
</> 123

---

| Column 1 | Column 2 |
|---|---|
| Text | <Hello>Text</Hello> |
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.