Drupal CKEditor module remove line breaks I have legacy content that has line breaks as paragraph separator. When trying to deal with them using CKEditor module 7.x-1.16 and CKEditor 4.5.4 library, all line breaks  are removed and the text turned into an ugly mass of text.

I tried disabling some filters from the Full HTML input format:


Limit allowed HTML tags
Convert line breaks into HTML 
Correct faulty and chopped off HTML


I also tried to use custom formatting options and disabling _Advanced content filter. In any case, I didn't achieve my purpose.
The solution is simply in two points:


Adding the following config to in the advanced option tab of the desired profile:
admin/config/content/ckeditor/edit/Full

config.protectedSource = [/\r|\n/g];


This will keep the source of the content with new lines as it is and forget about its shape in the wysiwyg.


In for the container that holds your content, use the following css rule:

white-space: pre-line;
This will keep lines separated as paragraphs.


checkout those screen shots:

Add the protected source config:
 

Don't worry about it in wysiwyg:


Just look at the source:


It will look like the following on the frontend:




  Don't forget to flush cache specially if you optimized and aggregate
  js and css, also remove your browser cache or enabling remove cache
  during using dev tools (chrome)