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

Auto fix jsx style comments in html block to html comments #18

Closed
JounQin opened this issue Aug 2, 2019 · 4 comments
Closed

Auto fix jsx style comments in html block to html comments #18

JounQin opened this issue Aug 2, 2019 · 4 comments
Assignees
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 🦋 type/enhancement This is great to have
Milestone

Comments

@JounQin
Copy link
Member

JounQin commented Aug 2, 2019

// input
Inline <Test>{/* it's a comment */}</Test>

// fixed output
Inline <Test><!-- it's a comment --></Test>

Which is an opposite of #13.

@JounQin JounQin added the 🦋 type/enhancement This is great to have label Aug 2, 2019
@JounQin JounQin self-assigned this Aug 2, 2019
@JounQin JounQin added this to the 2.0 milestone Aug 22, 2019
@JounQin
Copy link
Member Author

JounQin commented Feb 2, 2020

@mdx-js/maintainers I'm wondering whether it works as expected.

Inline <Button>{/* it's a comment */}</Button>

<Button>{/* it's a comment */}</Button>

image

They are not consistent IMO.

@wooorm
Copy link
Member

wooorm commented Feb 3, 2020

I don’t understand, could you expand on what your question is?

@JounQin
Copy link
Member Author

JounQin commented Feb 3, 2020

@wooorm Hmm... Did you see my capture of playground? Same "jsx" content emits different outputs due to "inline" paragraph(sorry I'm not a native English speaker).

In "inline" mode, the "jsx" children are considered as markdown content, what makes true jsx comments impossible.

@wooorm
Copy link
Member

wooorm commented Feb 3, 2020

I saw your code! Right!

So, there is a big difference between “inline” and “block” JSX.

Taking a different example, Inline <i>**emphasis and importance**</i> is “inline” (the markdown works), whereas <div>\n**no importance, this doesn’t work**\n</div> is block (the markdown doesn’t work).

See also: mdx-js/mdx#628

@JounQin JounQin added the 🙅 no/wontfix This is not (enough of) an issue for this project label Aug 20, 2020
@JounQin JounQin closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 🦋 type/enhancement This is great to have
Development

No branches or pull requests

2 participants