If have a field in my database with crlf's how do I preserve that in HTML??
Is there a standard way of doing this??
Malcolm
EDIT: I am actually doing an MVC app if that hepls.
I think the best way to do that is to replace the \r\n sequence with <br /> tags, using whatever scripting language your database-backed website is in.
Other options include placing the text within a <textarea>. Or, if it is appropriate for your site, using akin to the <pre> tag (or the CSS attribute white-space: pre).
You can search/replace those characters with <br /> to make the text output with breaklines. You could also use the <pre> tag to specify a particular piece of text's line breaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With