1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 13:18:29 +01:00
slate/packages/slate-html-serializer
danielsarin 4d31983a94 IE11 html serializer parser fix (#2087)
#### Is this adding or improving a _feature_ or fixing a _bug_?

This should fix `Unable to get property 'childNodes' of undefined or null reference` error in IE11 when using slate-html-serializer and deserializing an empty string (#1757, #1756).

#### What's the new behavior?

The `defaultParseHtml` now returns an empty body element if the parsed body is null. 

I tested this in the latest Chrome, Firefox and Safari, and they all seemed to work similarly. If the html param was an empty string, `parseFromString` returned a document element, which had a body property which was an empty body element. In IE11 though the body property was null, which caused the undefined or null reference later.

#### Have you checked that...?

* [x] The new code matches the existing patterns and styles.
* [x] The tests pass with `yarn test`.
* [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.)
* [x] The relevant examples still work. (Run examples with `yarn watch`.)
2018-08-16 15:05:08 -07:00
..
2018-07-27 12:40:04 -07:00
2018-08-15 18:03:10 -07:00

This package contains an HTML serializer for Slate documents, that you can configure depending on your custom schema.