Skip to content

HTMLtoJSX converter does not convert <textarea> and <pre> content correctly #33

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

Closed
sicks opened this issue Sep 4, 2015 · 3 comments
Closed
Assignees
Labels

Comments

@sicks
Copy link
Contributor

sicks commented Sep 4, 2015

Here's a fiddle

When HTML containing textarea's or pre's with newlines are fed into the HTML to JSX converter, the newlines in the textarea or pre are not converted the way they need to be for multiline content to remain intact. See why textarea value

JSX whitespace coalescing rules end up being applied when the result is rendered.

@Daniel15
Copy link
Member

Daniel15 commented Sep 6, 2015

Fantastic bug report, thank you! I'll take a look.

@Daniel15 Daniel15 added the bug label Sep 6, 2015
@Daniel15 Daniel15 self-assigned this Sep 6, 2015
@Daniel15
Copy link
Member

Daniel15 commented Sep 6, 2015

Done in 9056a27, let me know if I missed any edge cases :)

@sicks
Copy link
Contributor Author

sicks commented Sep 8, 2015

Thanks! One thing: textarea should use defaultValue instead of value, otherwise you can't edit the contents after they've been rendered.

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

No branches or pull requests

2 participants