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

Tag attributes are getting converted to lower case #67

Closed
matthewnitschke opened this issue Aug 26, 2018 · 4 comments
Closed

Tag attributes are getting converted to lower case #67

matthewnitschke opened this issue Aug 26, 2018 · 4 comments

Comments

@matthewnitschke
Copy link

When parsing a dom element with mixed case attribute names, the resulting react module has both the component name and attribute names to lower case. I understand the component name getting set to lower case is mentioned in #62, but the attributes also getting set to lowercase seems like a bug due to this line: https://github.com/remarkablemark/html-react-parser/blob/97d6868/index.js#L5 which specifically specifies to not lowercase attribute names.

Is a bug in htmlparser2? or is there some issue with this module?

@remarkablemark
Copy link
Owner

remarkablemark commented Aug 27, 2018

@matthewnitschke Can you help me reproduce your case? See Repl.it (click run to see the output).

@matthewnitschke
Copy link
Author

Ah, it appears as though my problem is only repeatable when using custom react components within the parse string. Correct me if I am wrong but I don't think this library is meant to handle that case

@remarkablemark
Copy link
Owner

Yes, that's correct. This library only parses HTML strings and not JSX strings to React elements.

I recommend using the replace option if you need custom overrides.

@matthewnitschke
Copy link
Author

Alright, thank you for your help

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

No branches or pull requests

2 participants