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

Deal with void element tags #17

Merged
merged 3 commits into from
Apr 25, 2016
Merged

Deal with void element tags #17

merged 3 commits into from
Apr 25, 2016

Conversation

mikenikles
Copy link
Owner

This is similar to #13, but a bit more generic. It also fixes parts of #8.

Status: Ready for review
Reviewers: @lithin @aknuds1

Changes

  • Created a list of void element tags (same as React uses to generate the console warnings)
  • Use the above list to determine when and when not to create children of a component
  • Added test cases to cover two void element tag scenarios

This was referenced Jan 31, 2016
@lithin
Copy link
Contributor

lithin commented Feb 3, 2016

Nice 👍

@@ -101,6 +101,25 @@ describe('Html2React', function() {

assert.equal(reactHtml, htmlExpected);
});

it('should parse br elements without warnings', function() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should've kept the wording in my PR, e.g. that the test asserts that children aren't created for void elements, as this is more direct.

@mikenikles
Copy link
Owner Author

@aknuds1 I've added the test case from your PR to cover your notes. Thanks for the feedback.

@RacingTadpole
Copy link

Looking forward to this one - thanks! Fixes #29.

@dannyjolie
Copy link

Any chance of seeing this in a new release anytime soon? As it stands, non existing support for void tags is kinda sorta a deal breaker for an otherwise really useful library.

@MDSLKTR
Copy link

MDSLKTR commented Apr 13, 2016

would really like to see the PRs here getting merged.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 39ea155 on feature-add-more-tests into 4ea8499 on master.

@mikenikles mikenikles merged commit f78c615 into master Apr 25, 2016
@mikenikles mikenikles deleted the feature-add-more-tests branch April 25, 2016 01:21
@mikenikles
Copy link
Owner Author

Fixes #29 as well.

@mikenikles mikenikles modified the milestone: v1.0.0 May 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
7 participants