mdx
mdx copied to clipboard
`position` is missing is `mdxJsxAttribute` node
Initial checklist
- [X] I read the support docs
- [X] I read the contributing guide
- [X] I agree to follow the code of conduct
- [X] I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
remark-mdx
Link to runnable example
No response
Steps to reproduce
<div abc="xxx"></div>
Expected behavior
Add position in mdxJsxAttribute node
Actual behavior
{
"type": "root",
"children": [
{
"type": "mdxJsxFlowElement",
"name": "div",
"attributes": [
{
"type": "mdxJsxAttribute",
"name": "abc",
"value": "xxx"
}
],
"children": [],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 1,
"column": 22,
"offset": 21
}
},
"data": {
"_mdxExplicitJsx": true
}
}
],
"position": {
"start": {
"line": 1,
"column": 1,
"offset": 0
},
"end": {
"line": 2,
"column": 1,
"offset": 22
}
}
}
Runtime
Node v16
Package manager
yarn v1
OS
macOS
Build and bundle tools
No response
Could you try and reduce the MDX of this error, and see if it still persists? Are all those spaces needed for the problem?
Could you try and reduce the MDX of this error, and see if it still persists? Are all those spaces needed for the problem?
Done, the white spaces are not required.
See https://github.com/syntax-tree/mdast-util-mdx-jsx/blob/main/lib/index.js#L190
Should move this issue to there instead.
Ahh. This is not technically hard to fix. But it is somewhat intentional. In unist, nodes are in 'children'. These are somewhere else. So they're not really nodes. But maybe that doesn't matter practically.
Do you want to explore the solution in a pull request?
Do you want to explore the solution in a pull request?
Yeah, I'd like to do it when I'm free this week.
@wooorm Can you move this issue to https://github.com/syntax-tree/mdast-util-mdx-jsx and assign it to me?
I don’t believe GH allows moving across organizations unfortunately :'( Feel free to open a small one there that references this. Or we’ll just keep this one. I’ll assign you here at least!
Moved to https://github.com/syntax-tree/mdast-util-mdx-jsx/issues/8!