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

Don't parse ES syntax in open blocks #763

Merged
merged 2 commits into from
Sep 3, 2019
Merged

Don't parse ES syntax in open blocks #763

merged 2 commits into from
Sep 3, 2019

Conversation

johno
Copy link
Member

@johno johno commented Sep 3, 2019

When a block is open, such as a list or blockquote,
we shouldn't attempt to parse import/export syntax.

Additionally, if a paragraph begins with import/export
and doesn't parse, we now make it a raw paragraph
node.

Related gatsbyjs/gatsby#17315

When a block is open, such as a list or blockquote,
we shouldn't attempt to parse import/export syntax.

Related gatsbyjs/gatsby#17315
@johno johno requested a review from wooorm September 3, 2019 16:37
@vercel
Copy link

vercel bot commented Sep 3, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://mdx-git-es-syntax-blocks.mdx.now.sh

@johno johno merged commit 3430138 into master Sep 3, 2019
@johno johno deleted the es-syntax-blocks branch September 3, 2019 16:55
@JounQin
Copy link
Member

JounQin commented Sep 4, 2019

@ChristopherBiscardi @johno @wooorm
This fix breaks a fixture of eslint-mdx.

The error detail should be checked whether it is a syntax error.

Example:

import A from 'x'
import A from 'y'

It should throw error instead of parsed as paragraph.

You can check https://travis-ci.com/rx-ts/eslint-mdx/builds/125786664#L355 for detail.

@johno
Copy link
Member Author

johno commented Sep 4, 2019

Hmm, yeah I guess we should revert the error catching piece 🤔

johno added a commit that referenced this pull request Sep 4, 2019
This also catches valid errors like duplicate imports
so for now we shouldn't catch these.

Related #763
johno added a commit that referenced this pull request Sep 4, 2019
This also catches valid errors like duplicate imports
so for now we shouldn't catch these.

Related #763
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants