Skip to content

Commit 01cfe91

Browse files
committed
Add a test for flow elements on same line
1 parent 6f6b6f4 commit 01cfe91

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,37 @@ test('markdown -> mdast', function (t) {
11611161
'should support normal markdown w/o jsx'
11621162
)
11631163

1164+
t.deepEqual(
1165+
removePosition(
1166+
fromMarkdown('<x><y>\n\nz\n\n</y></x>', {
1167+
extensions: [syntax({acorn: acorn})],
1168+
mdastExtensions: [mdxJsx.fromMarkdown]
1169+
}),
1170+
true
1171+
),
1172+
{
1173+
type: 'root',
1174+
children: [
1175+
{
1176+
type: 'mdxJsxFlowElement',
1177+
name: 'x',
1178+
attributes: [],
1179+
children: [
1180+
{
1181+
type: 'mdxJsxFlowElement',
1182+
name: 'y',
1183+
attributes: [],
1184+
children: [
1185+
{type: 'paragraph', children: [{type: 'text', value: 'z'}]}
1186+
]
1187+
}
1188+
]
1189+
}
1190+
]
1191+
},
1192+
'should support multiple flow elements with their tags on the same line'
1193+
)
1194+
11641195
t.end()
11651196
})
11661197

0 commit comments

Comments
 (0)