-
<A . B . C></ A .B .C > {
"type": "root",
"children": [
{
"type": "mdxJsxFlowElement",
"name": "A.B.C", // I cann't get original `A . B . C` and ` A .B .C ` info any more
"attributes": [],
"children": [],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 39,
"offset": 38
}
},
"data": {
"_mdxExplicitJsx": true
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 2,
"column": 1,
"offset": 39
}
}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi! This behavior is expected. The whitespace is meaningless. Theoretically in JS you could even have comments in there, although that isn’t supported in MDX. All whitespace that is meaningless, is ignored in the AST in other places too. ASTs are supposed to make inspecting and modifying them easier, this goes agains that. If you want such features, you should probably not use the AST tools we provide. But work with the events. It’s going to get complex though: https://github.com/micromark/micromark#architecture |
Beta Was this translation helpful? Give feedback.
Hi! This behavior is expected.
The whitespace is meaningless. Theoretically in JS you could even have comments in there, although that isn’t supported in MDX. All whitespace that is meaningless, is ignored in the AST in other places too.
ASTs are supposed to make inspecting and modifying them easier, this goes agains that.
Even if we did, we’d never show the closing tag name.
If you want such features, you should probably not use the AST tools we provide. But work with the events. It’s going to get complex though: https://github.com/micromark/micromark#architecture