stable

Clone or download

Read-only

fix: editor content is not saved the right way

part of story #38627: Choice of a new Rich Text Editor Currently, to save the content of an editor, we have a plugin called PluginInput. When the document in the editor is updated, this plugin executes a callback, passing it the DOM inside the editor's view. However, it seems not to be the right way to do it. There is a method in DOMSerializer called serializeFragment that takes the content of a node and serializes it without all the fancy stuff ProseMirror puts in the editor view. Let's serialize the document content and pass it to the callback, so the saved DOM is not polluted. How to test - In an editor, write some text, jump some lines - Save --> No extra line break have been added to the editor. Change-Id: I8aa59aa0ee10095d17db2559417e575850c66bc1

Modified Files

Name
M lib/frontend/prose-mirror-editor/src/plugins/input/input.ts +15 −1 Go to diff View file