Closed JonasDoebertin closed 9 years ago
an option would be to convert to plaintext via innerTEXT, cf. http://stackoverflow.com/questions/6899659/remove-formatting-from-a-contenteditable-div
The way the field works is that everytime the user modifies the content within the editor, the whole content is mirrored into a hidden textarea. This happens, since the medium editor uses a contenteditable
<div>
and the panel doesn't know how to save these. The panel will save the textarea as the field value instead.
So I guess we have to filter through the textarea and remove all <span>
elements (only the tags, not the content). The easiest way would be to do this server side, once the user hits the "Save" button. We can't just remove all HTML, since the editor allows for some formatting options that Markdown just don't support, like subscript, superscript, del, ins and mark tags. They are embedded as inline html (which is explicitly allowed in Markdown).
I'll prepare something tomorrow.
Fixed with 2b9fe86365530b160a16673bf402ce43ec9a931a.
Sometimes, when copy and pasting text inside the editor, there are some wild
<span>
elements being added. As they randomly haveline-height
andfont-size
inline styles attached, they might break the pages design.