Jquery beautyofCode show code lines from a string
I'm using BeautyofCode jQuery plugin, but i can't understand 1 thing.
I submit a piece of code by a simple textarea then save that i开发者_如何转开发nto db record.
Once i retrieve piece of code from db as a string js plugin show me code all in 1 line, wondering how to split lines when submitting code from textarea? :P
The line breaks are probably being saved as \n
and when you look at what comes from the database you don't see the line-breaks because HTML does not recognize \n
, what you need to do is convert all \n
's to <br />
's so the HTML will display appropriately.
精彩评论