medium-editor
medium-editor copied to clipboard
Pasting removes empty newlines
Description
Pasting text from the attached doc removes the empty lines.
medium-editor-paste-issue.docx
Reading other issues regarding the empty lines and the paste I found that for some people the fix was to replace <p><br></p>
parts with the <p> </p>
.
I tried doing that with following paste options:
paste: {
preCleanReplacements: [[new RegExp(/<p [^>]*><br><\/p>/g), '<p> </p>']],
cleanPastedHTML: true,
},
But that didn't fix the issue for me as it seems that <p> </p>
were removed further in a cleanup process. That also broke setting text from the backend into the editor for me, which could be something in my project.
Versions
- medium-editor: 5.23.3
- browser: Google Chrome 71.0.3578.98
- OS: Windows 10
Any possible solution for not skipping the empty lines?