bustle / mobiledoc-kit

A toolkit for building WYSIWYG editors with Mobiledoc
https://bustle.github.io/mobiledoc-kit/demo/
MIT License
1.55k stars 150 forks source link

648 Fix proposal 1: Remove wrappers #655

Closed ErisDS closed 5 years ago

ErisDS commented 5 years ago

This PR is a proposal to fix part of #648, where wrapping divs cause paragraphs and other "section" elements to be incorrectly merged.

It is not the preferred fix. The preferred fix is Proposal 2 😁


The first 3 commits are tests only.

The final commit adds a recursive search for the root element. It attempts to find the innermost wrapper

or
and use this as the root element. The children of this innermost wrapper are then iterated over as sections, the same as before.

ErisDS commented 5 years ago

Closing in favour of #658