HTML is escaped when you output it as plaintext. This code does what
you want: swapDOM('bleh', SPAN('Hello!', BR(), 'This is a
linebreak!'));
Complexity is to determine places where actual BR elements have to be
and place them accordingly. This works, if you can split incoming
string by some substring into array; I use newline here:

var str0 = 'Hello!\nThis is a linebreak!\nAnd another one.';
var arr0 = str0.split('\n');
var arr1 = new Array(arr0.length * 2 - 1);
arr1[0] = arr0[0];
for (var i = 1; i < arr0.length; i++) {
        arr1[i * 2 - 1] = BR();
        arr1[i * 2] = SPAN(arr0[i]);
}
swapDOM('bleh', SPAN(null, arr1));


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to