I’ve made a start on a package that provides React components for editing rich text using ProseMirror 1.0.
It currently provides two components:
Editor, which saves the content as ProseMirror JSON, and
HtmlEditor, which converts the content to and from HTML.
It works well for my use case, which is a single editor on a page, but I’m not sure how best to use
componentWillReceiveProps to update the editor if the props change (currently it just attaches the editor when the component mounts and lets ProseMirror handle all the rendering). Does anyone have any ideas how this could be improved?
The conversion to and from HTML is nice and simple thanks to ProseMirror’s DOMParser and DOMSerializer. I wonder if perhaps the
serializeFragment methods could be updated to convert to/from strings as well as DOM nodes?