fix(mdx): handle inline html correctly (#5704)
parent
1ca473186a
commit
63999c74eb
|
@ -55,7 +55,9 @@ function htmlToJsx() {
|
|||
node.type !== "html" ||
|
||||
/^<!--[\s\S]*-->$/.test(node.value) ||
|
||||
// inline html
|
||||
parent.type === "paragraph"
|
||||
(parent.type === "paragraph" ||
|
||||
parent.type === "tableCell" ||
|
||||
parent.type === "heading")
|
||||
) {
|
||||
return node;
|
||||
}
|
||||
|
|
|
@ -188,6 +188,12 @@ printWidth: 80
|
|||
test <World /> test
|
||||
</Hello>
|
||||
|
||||
---
|
||||
|
||||
| Column 1 | Column 2 |
|
||||
|---|---|
|
||||
| Text | <Hello>Text</Hello> |
|
||||
|
||||
=====================================output=====================================
|
||||
<Heading hi="there">Hello, world!</Heading>
|
||||
|
||||
|
@ -197,6 +203,12 @@ printWidth: 80
|
|||
test <World /> test
|
||||
</Hello>
|
||||
|
||||
---
|
||||
|
||||
| Column 1 | Column 2 |
|
||||
| -------- | ------------------- |
|
||||
| Text | <Hello>Text</Hello> |
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
|
@ -216,6 +228,12 @@ semi: false
|
|||
test <World /> test
|
||||
</Hello>
|
||||
|
||||
---
|
||||
|
||||
| Column 1 | Column 2 |
|
||||
|---|---|
|
||||
| Text | <Hello>Text</Hello> |
|
||||
|
||||
=====================================output=====================================
|
||||
<Heading hi="there">Hello, world!</Heading>
|
||||
|
||||
|
@ -225,6 +243,12 @@ semi: false
|
|||
test <World /> test
|
||||
</Hello>
|
||||
|
||||
---
|
||||
|
||||
| Column 1 | Column 2 |
|
||||
| -------- | ------------------- |
|
||||
| Text | <Hello>Text</Hello> |
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
|
|
|
@ -6,3 +6,9 @@
|
|||
<Hello>
|
||||
test <World /> test
|
||||
</Hello>
|
||||
|
||||
---
|
||||
|
||||
| Column 1 | Column 2 |
|
||||
|---|---|
|
||||
| Text | <Hello>Text</Hello> |
|
||||
|
|
Loading…
Reference in New Issue