ContentEditable and document consitency

Hello,

As we all know ContentEditable has a lot of downsides which are, at least partially, summarized in this write-up https://medium.engineering/why-contenteditable-is-terrible-122d8a40e480

After looking at https://github.com/ProseMirror/prosemirror/blob/master/src/model/content.js#L71 https://github.com/ProseMirror/prosemirror/blob/master/src/model/from_dom.js I can make a conclusion that ProseMirror doesn’t proxy user input to create an internal model but rather parses DOM afterwards. Is this correct?

What is the ProseMirror position on document inconsistencies? Will document that was entered in different browsers have same JSON representation?

No, that isn’t correct.

Hello Marijn,

I know that you’re on vacation and want to thank you for the reply. Can you please shed a light on the ProseMirror mechanics, please? I tried to look through the documentation but couldn’t find any description of how does it work.

Our use case assumes that document’s JSON representation will be clean and browser agnostic. And by “clean” I mean that there will be no noise/“lost” tags in the structure.

I think the “General Approach” part of this blog post explains the ProseMirror mechanics that you are interested in.

Thank you @kiejo! Now I remembered that article and why I was attracted to PM in the first place :wink: