contentstack / json-rte-serializer

The JSON RTE Serializer package helps you convert the data inside your JSON Rich Text Editor field from JSON to HTML format and vice versa.
MIT License
9 stars 7 forks source link

feat: added condiition to check for text nodes with empty white space #29

Closed Jayesh2812 closed 1 year ago

Jayesh2812 commented 1 year ago

Issue: Empty whitespace between nodes (because of formatting) was converted to text nodes having only whitespace, since these text nodes were between block nodes they were wrapped in fragment node, causing extra fragment node to be inserted in JSON.
Solution: Added condition to check for text nodes with empty white space using trim and length which are present inside table, tbody, thead, tr