I have a string:
<Grid><Description>LINE 1
LINE 2
LINE 3
LINE 4
</Description><</Grid>
I need it to be decoded with line breaks. I found solution:
function decodeString(stringToDecode) {
if (!stringToDecode) {
return stringToDecode;
}
return $('<div />').html(stringToDecode).text();
}
But it makes single line and replaces all the line breaks with spaces.