-
Notifications
You must be signed in to change notification settings - Fork 45.8k
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
HTML to JSX converter doesn't correctly parse className parameter in tag #1529
Comments
Oops! Yeah that's weird. |
Ah, I thought that as supported attributes the converter would parse them correctly? |
@merges Hmm, I think it's labeled a little weirdly, you're supposed to paste HTML to the left (i.e |
The issue I had was that I had partially supported JSX, and needed to use the converter to check something in a large block of markup. It correctly fixed that problem, but spit out the aforementioned |
Yea, that's labeled weirdly, you should be pasting HTML into the left. But we should probably leave case intact for unrecognized attributes (cc @Daniel15) |
The input field wasn't labelled as "Live JSX Editor" when I initially built the page, I guess that's a more recent change. I think the issue with the className attribute is that the HTML to JSX converter uses the browser's HTML parsing, which normalises the case of attributes. I could special-case |
Moving this issue to https://github.com/reactjs/react-magic since the HTMLToJSX converter now lives entirely in that project. |
<div className="blah"></div>
into Live JSX EditorEXPECTED RESULT
className is still className in the conversion
ACTUAL RESULT
className is converted to classname; this is invalid JSX
The text was updated successfully, but these errors were encountered: