We (the Guardian) created Scribe to tackle this:
https://github.com/guardian/scribe
(I can't take any credit personally though alas!)
We (the Guardian) created Scribe to tackle this:
https://github.com/guardian/scribe
(I can't take any credit personally though alas!)
Trix's thesis is that this approach is fundamentally broken. Instead, Trix updates an internal document model on each input event, then re-renders the editor contents in response.
Basically, http://jsfiddle.net/L59kL1rf/ -- you cannot delete the first paragraph and always end up with <p><br /></p> and if you try to delete that it just starts acting strange. This issue has been open since 2014 and it seems it's a bug in the core.
There were other similar issues I ran into around the same and decided I would revisit later but it's been a nearly a year since.