Displaying linebreaks for description tags

This commit is contained in:
Andreas Stöckel 2012-03-12 13:41:10 +00:00
parent 28aeb06238
commit a9967f678d

View File

@ -520,7 +520,18 @@ function et2_insertLinkText(_text, _node, _target)
if (typeof s == "string" || typeof s == "number") if (typeof s == "string" || typeof s == "number")
{ {
_node.appendChild(document.createTextNode(s)); // Include line breaks
var broken = s.split('\n');
for (var j = 0; j < broken.length; j++)
{
_node.appendChild(document.createTextNode(broken[j]));
if (j <= broken.length - 1)
{
_node.appendChild(document.createElement("br"));
}
}
} }
else else
{ {