I noticed that the file size badge didn't change when Cheerio was removed in 0.21.0. Because I stupidly pinned it to version 0.19.0 😳 - this will now always show the gzip size of the latest release
* Replace cheerio with parse5
* Convert to dependency injection for HTML parser
* Add options.domParser to HTML serializer
* Fallback to native DOMParser if present and no option provided
* Error if no DOM parser is available (option or native)
* Update tests to pass parse5 as config option
* Update test so it passes.
Cheerio interprets `<p><hr /></p>` as one `p` node with a child `hr`
node, but both parse5 and native DOMParser interpret it as 3 nodes: a
blank `p` node, `hr` node, and second blank `p` node. Update test
expectation to match new API.
* Remove cheerio-esque compatibility conversion.
* Use `application/xml` in native DOMParser
Using `text/html` causes it to wrap the fragment in html, body, etc
* Change error message to single line.
Was inserting an undesired newline char
* Add documentation for new `domParser` option to html serializer
Also boyscout missing documentation for `defaultBlockType` option
* Rename `domParser` option to `parseHtml`
Rename the option to make it clearer what it does, since it accepts a
function and not a `DOMParser` analogue object.
* Allow HTML serializer to deserialize an empty document
This specially handles the case where the HTML is empty.
Test by running:
```
const html = new HTML()
html.deserialize('')
```
Closes#539
* Use defaultBlockType in HTML serializer
* Add test case for deserialising empty string
* Use fixtures
* Fix Edge doctype warning
* Remove getData() calls in onDragOver
Access to data within ondragover is prohibited
* Handle Edge errors accessing `dataTransfer.dropEffect`
* Work around Edge not supporting custom data in drag events
If unable to use `setData()` with custom type, then uses JSON obj to store data in 'text/plain'
* Fix more Edge errors
Edge sometimes throws 'NotSupportedError' whena accessing `items` property on `dataTransfer`
* Fix linting errors
* Fix formatting
* Add `data` field to editor `State`.
Plugins can use it to store their own internal state.
* Remove `serialize` and `deserialize` plugin methods.
* Add operation to set `data` on a state.
* Add `setDataOperation` tests.
* Remove the possibility to use keys different from strings.
Add `preserveData` option to `raw.serialize`.
Rewrite `set-data` test exploiting the new option.
* Add property isEmpty to State
* Update hovering menu example
* Document isEmpty
* Improve perf of isEmpty with @Soreine 's suggestion
* Fix return of isEmpty
I tried using the exact code from the example to be met by errors.
The order of arguments in the function example is wrong, it should be use the API described in the [docs](https://docs.slatejs.org/reference/plugins/plugin.html#onbeforeinput).
```
Function onBeforeInput(event: Event, data: Object, state: State, editor: Editor) => State || Void
```
* Add failing test for wrapInline
* Adapt tests for wrap-twice and whole-block
* Adapt transform to move selection correctly
* Fix lint errors
* Use keys in yaml
The native selection will be updated after componentDidMount or componentDidUpdate.
Use setTimeout to queue scrolling to the last when the native selection has been updated to the correct value.
* Update url when testing locally
When attempting to mess around locally I could never get anything to update. Sure enough I was looking in the wrong place and had missed the `/dev.html` on the end of my url.
Here's to hoping no one else struggles with this again.
* Update Readme.md