Skip to content

Commit

Permalink
Merge pull request #555 from webkom/fix-serializer-domparser
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigHz authored Aug 12, 2022
2 parents 7a31c90 + b5f61f5 commit cc5ba18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/serializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ export const deserialize = (
): SlateNode | string | (SlateNode | string)[] => {
// See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
// for what the different nodeTypes are.
if (element.nodeType === Node.TEXT_NODE) {
if (element.nodeType === 3) {
return element.textContent || '';
} else if (element.nodeType !== Node.ELEMENT_NODE) {
} else if (element.nodeType !== 1) {
return '';
} else if (element.nodeName === 'BR') {
return '\n';
Expand Down

0 comments on commit cc5ba18

Please sign in to comment.