If I have a span tag like this:
<span>Hi<br />SecondLine</span>
And I call this jQuery function:
var html = $('span').html();
html is set to:
Hi<br>SecondLine
Now, I realize the name of the function is html() and not xhtml(). But is this expected behavior? Can I count on it, or do I alway need to check for a xhtml br tag and an html br tag, in say, this example:
function br2nl(text) {
return text.replace(/<br \/>/gi, '\n').replace(/<br>/gi, '\n');
}