hectorguo / CKEditor-Markdown-Plugin

Markdown Plugin for CKEditor
http://hectorguo.github.io/CKEditor-Markdown-Plugin/
112 stars 24 forks source link

removed newlines from certain blocks #12

Open tablatronix opened 8 years ago

tablatronix commented 8 years ago

similar to #11

if you have a pre block all newlines in it are removed when switching to markdown.

Reproduce

goto demo

http://hectorguo.com/CKEditor-Markdown-Plugin/ enter multi line text, highlight, click format combo change to formatted switch to markdown and see that all formatting is removed, newlines are gone text becomes single line inline looking.

tablatronix commented 8 years ago

Remove newline formatting solution is flawed.

daxhns commented 7 years ago

Hi, @tablatronix having the same problem with newlines dissapearing inside <pre>

Found the same solution as you did, removing .replace in plugin.js...

//htmlData = editor.getData(1).replace(/(\r\n|\n|\r)/gm,""); // remove all linebreaks to prevent some parsing issues
htmlData = editor.getData(1);

I am now wondering if this introduces any other issues, as the comment states that newlines are removed to 'prevent some parsing issues'.... did you encounter any of those?

tablatronix commented 7 years ago

I cant say, i never wound up using this in production.