• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Any Codemirror expert on here I have a Question

#1
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.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply

#2
You may need to play around with the editor configuration line separator.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(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;
}
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply

#4
Glad to see you got it working.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.