8
I have a file json that in its contents it contains paragraphs. These paragraphs are separated by \n
but when I insert the content the paragraphs are not separated and instead of line break I have a space in the DIV
. In my view my solution would be to convert the \n
in line breaks that the HTML
understands (<p>
or <br>
). What is the most correct method to use?
Questions about what is most correct are always more complicated. They lead to subjective answers. I’m not saying that the question in its general form cannot be answered. I am seeing many questions just about what is right and it is not always easy to say that. Giving a correct solution is easier. If you do not know which is the most correct, how will you choose the answer to be accepted?
– Maniero
there are numerous ways to treat my need above, what I’m looking for is which form is most used, with the intention of making use of some general standard or more current and viable methods @bigown.
– LeandroLuk
Your question is being discussed here: http://meta.answall.com/questions/76/o-doir-quando-os-votos-seem_incoerentes-com-conteudo-. It would be interesting if you could try to improve it to avoid misinterpretations.
– Maniero
function nl2br do php, written in javascript: http://phpjs.org/functions/nl2br/
– Daniel Omine