CodeIgniter Forums

Full Version: [Solved] Any Codemirror expert on here I have a Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am working with codeigniter & Codemirror for my custom text-editor

But for some reason when I add new line in the text editor it does not show the new lines created in the question-preview div

In the question-preview div which is below the bootstrap panel  it shows all the code in one line. I need to be able to make sure it displays it new lines  correct as well in my question-preview div.

Here is a Codepen Demo

Thank you in advance.
You may need to play around with the editor configuration line separator.
(01-10-2016, 04:25 AM)InsiteFX Wrote: [ -> ]You may need to play around with the editor configuration line separator.

I have found out how to do it

On my script added


Code:
<br/> to

editor.getValue('<br>')


And added some css

Code:
#question-preview {
   white-space:pre-line;
}

#question-preview pre code {
   padding: 0;
   white-space: inherit;
}
Glad to see you got it working.