I have some strings which have line breaks inside, in console they are shown with breaks:
string1:
test 1
test 2
test 3
I need to split the string and make something like this:
string1:
<p>test 1</p>
<p>test 2</p>
<p>test 3</p>
For most of them the next code works:
string1.split('\n\n').join('</p><p>')
but for some strings this doesn't work, so I could assume they have some other line breaks, for example '\r\n'
Can I somehow see all line breaks as they are? I mean as something like the next:
string1:
test 1\n\n
test 2\n\n
test 3\n\n