Skip to content

MDX parser cannot parse HTML and React components in table cells when surrounded by markdown syntax #5782

@manovotny

Description

@manovotny

This isn't a regression in 1.16.0. I was doing this before today's release.

I thought this might have been resolved with #5702, but it must go another level deeper.

This may also be related to the other issue I opened, #5781.

Prettier 1.16.0
Playground link

--parser mdx
--no-semi
--single-quote

Input:

export const InlineCode = ({children}) =>
	<code>{chidlren}</code>

| Column 1 | Column 2 |
| -- | -- |
| **`Row 1 Code`** | Some text. |
| **<code>Row 2 Code</code>** | Some text. |
| **<InlineCode>Row 2 Code</InlineCode>** | Some text. |

Output:

SyntaxError: Unexpected token (1:7)
> 1 | <code>
    |       ^

Expected behavior:

HTML and React components should be able to be used intermingled with markdown syntax in tables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions