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

Transform content example broken with remark 13+ #1440

Closed
jvelo opened this issue Jan 18, 2021 · 4 comments
Closed

Transform content example broken with remark 13+ #1440

jvelo opened this issue Jan 18, 2021 · 4 comments
Labels
🙋 no/question This does not need any changes

Comments

@jvelo
Copy link

jvelo commented Jan 18, 2021

Subject of the issue

The transform content example in the docs yields the expected output when running against remark 12 or below ; but a different output with remark 13

This is not a place to ask questions. For that, go to Discussions

Your environment

  • OS: macOS Big sur
  • Packages: @mdx-js/mdx 1.6.22, remark 13.0.0
  • Env: node 12, yarn 1.22

Steps to reproduce

See repos at https://github.com/jvelo/mdx-transform-remark13

Running node index.js yields:

{
  type: 'root',
  children: [
    { type: 'paragraph', children: [Array], position: [Object] },
    { type: 'paragraph', children: [Array], position: [Object] },
    {
      type: 'heading',
      depth: 1,
      children: [Array],
      position: [Object]
    },
    { type: 'paragraph', children: [Array], position: [Object] },
    { type: 'html', value: '<Component />', position: [Object] }
  ],
  position: {
    start: { line: 1, column: 1, offset: 0 },
    end: { line: 12, column: 1, offset: 107 }
  }
}

Expected behaviour

While running it against remark 12.x yields the expected

{
  type: 'root',
  children: [
    {
      type: 'import',
      value: "import Component from 'Component'",
      position: [Position]
    },
    {
      type: 'export',
      value: "export const meta = {\nprop: 'value'\n}",
      position: [Position]
    },
    {
      type: 'heading',
      depth: 1,
      children: [Array],
      position: [Position]
    },
    { type: 'paragraph', children: [Array], position: [Position] },
    { type: 'jsx', value: '<Component />', position: [Position] }
  ],
  position: {
    start: { line: 1, column: 1, offset: 0 },
    end: { line: 12, column: 1, offset: 107 }
  }
}
@jvelo jvelo added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Jan 18, 2021
@jvelo
Copy link
Author

jvelo commented Jan 18, 2021

At a lower level looks like the incompatibility lays between remark-parse 8.x vs. 9.x

@cha0s
Copy link

cha0s commented Feb 15, 2021

Can confirm that it works with 8.x and not with 9.x

@ChristianMurphy
Copy link
Member

mdx 2 (in beta) supports remark 13+, you can find out more here: #1041
mdx 1 still needs remark 12.

@ChristianMurphy ChristianMurphy added 🙋 no/question This does not need any changes and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Feb 15, 2021
@pd4d10
Copy link
Contributor

pd4d10 commented Feb 25, 2021

Hi, just running into this issue.

The latest version v2.0.0-next.8 seems still use remark-parse@8 (remark@12).

In which branch does remark@13 compatible version land? Thanks!

Update: It hasn't been published to NPM yet. Code here:

"remark-parse": "^9.0.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

4 participants