Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Avoid creating children for br elements #8

Closed
wants to merge 10 commits into from

Conversation

aknuds1
Copy link
Collaborator

@aknuds1 aknuds1 commented Dec 12, 2015

When generating React components for br elements and specifying children as per usual, React will warn later that void elements such as br should not have children.

This PR ensures that React components created from br elements are created without children and adds a test for it as well.

Additionally, I made sure to decode HTML entities of text nodes before handing them over to React.createElement as the latter will do its own encoding (and in effect double encode HTML entities), as well as adding a .editorconfig file for ease of editing.

@aknuds1
Copy link
Collaborator Author

aknuds1 commented Dec 12, 2015

@mikenikles Do you have any idea what causes tests on Travis to fail? npm run test-locally works
FWIW.

@mikenikles
Copy link
Owner

Hey @aknuds1, the travis builds failed due to a newer version of blanket. I implemented a workaround in #12.
Also, #17 fixes the br issue generically, taking into consideration any other void element tag.

@aknuds1 aknuds1 closed this Feb 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants