I'm trying to get a textnode with new lines in it (my text contains \n
and x0a
). I found the way to do this, using white-space: pre
, and it works, but the problem is that the content doesn't fit to the parent div, I got the new lines in the text, but when the line is long, it goes beyond the window.
This is the code:
var textdata = document.createTextNode(text_with_multiples_lines);
PanelBody.style = "white-space: pre;"
PanelBody.appendChild(textdata);
Somebody know how to make new lines inside a textnode without exceeding the window size?