Skip to content

Commit 35b6a25

Browse files
committed
reproduce inline jsx issue [ci skip]
1 parent f449067 commit 35b6a25

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/traverse.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ export class Traverse {
2121
this._enter(node, parent)
2222

2323
if (node.children) {
24+
/**
25+
* FIXME: inline jsx:
26+
*
27+
* {
28+
type: 'jsx',
29+
value: '<b>',
30+
position: Position { start: [Object], end: [Object], indent: [] }
31+
},
32+
{
33+
type: 'text',
34+
value: 'velit',
35+
position: Position { start: [Object], end: [Object], indent: [] }
36+
},
37+
{
38+
type: 'jsx',
39+
value: '</b>',
40+
position: Position { start: [Object], end: [Object], indent: [] }
41+
}
42+
*/
43+
console.log(node.children)
2444
parent = node as Parent
2545
parent.children.forEach(child => this.traverse(child, parent))
2646
}

test/fixture.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Component from './component'
2+
3+
export const meta = {
4+
title: 'Blog Post',
5+
}
6+
7+
# Blog Post
8+
9+
Lorem ipsum dolor sit amet, consectetur adipiscing **elit**. Ut ac lobortis <b>velit</b>.
10+
11+
<!-- This is a comment -->
12+
13+
```css
14+
@media (min-width: 400px) {
15+
border-color: #000;
16+
}
17+
```
18+
19+
<Component>
20+
{/* This is a comment */}
21+
</Component>
22+
23+
## Subtitle
24+
25+
Lorem ipsum dolor sit _amet_, consectetur adipiscing elit. Ut ac lobortis velit.

0 commit comments

Comments
 (0)