Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

position is missing is mdxJsxAttribute node #2034

Closed
4 tasks done
JounQin opened this issue May 11, 2022 · 7 comments
Closed
4 tasks done

position is missing is mdxJsxAttribute node #2034

JounQin opened this issue May 11, 2022 · 7 comments
Assignees
Labels
👀 no/external This makes more sense somewhere else

Comments

@JounQin
Copy link
Member

JounQin commented May 11, 2022

Initial checklist

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

@wooorm
Copy link
Member

wooorm commented May 11, 2022

Could you try and reduce the MDX of this error, and see if it still persists? Are all those spaces needed for the problem?

@JounQin
Copy link
Member Author

JounQin commented May 11, 2022

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.

@wooorm
Copy link
Member

wooorm commented May 11, 2022

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?

@JounQin
Copy link
Member Author

JounQin commented May 11, 2022

Do you want to explore the solution in a pull request?

Yeah, I'd like to do it when I'm free this week.

@JounQin
Copy link
Member Author

JounQin commented May 11, 2022

@wooorm Can you move this issue to https://github.com/syntax-tree/mdast-util-mdx-jsx and assign it to me?

@wooorm
Copy link
Member

wooorm commented May 11, 2022

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!

@wooorm
Copy link
Member

wooorm commented Feb 9, 2023

Moved to syntax-tree/mdast-util-mdx-jsx#8!

@wooorm wooorm closed this as completed Feb 9, 2023
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Feb 9, 2023
wooorm pushed a commit to syntax-tree/mdast-util-mdx-jsx that referenced this issue Feb 10, 2024
Closes GH-8.
Closes GH-11.
Related-to: mdx-js/mdx#2034.

Reviewed-by: Remco Haszing <remcohaszing@gmail.com>
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else
Development

No branches or pull requests

2 participants