Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Accept root nodes #10

Closed
wants to merge 3 commits into from
Closed

Conversation

derhuerst
Copy link
Contributor

@derhuerst derhuerst commented Dec 1, 2017

This PR just uses a <div> element if there are more than 1 children in the root root node.

@wooorm wooorm changed the title accept root nodes Accept root nodes Dec 3, 2017
@wooorm wooorm added 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change minor labels Dec 3, 2017
@wooorm wooorm closed this in ab844cc Dec 3, 2017
@wooorm
Copy link
Member

wooorm commented Dec 3, 2017

Thanks! I amended it a bit, notably:

  • not pulling in unist-builder to create a simple JSON structure (div)
  • making sure that one child is an element (comments, doctypes, texts would cause errors)
  • allowing a root without children, instead of throwing
  • adding docs
  • changed the tests a bit to maintain style

But awesome, thanks for working on it!

@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface labels Aug 11, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

2 participants