function extractTextWithWhitespaceWorker(elems, lineBreakNodeName,is_return_data)
{
    var ret = "";
    var elem;

    for (var i = 0; elems[i]; i++)
    {
        elem = elems[i];
        if (elem.nodeType === 3     // text node
            || elem.nodeType === 4) // CDATA node
        {
        	if(elem.data.length > 0){
            	ret += elem.nodeValue;
        	}
        }

        if ((elem.nodeType !== 8 && !is_return_data ) || (elem.nodeType !== 8 && elem.nodeName != 'A')) // comment node
        {
            ret += extractTextWithWhitespace(elem.childNodes, is_return_data);
        } else if( elem.nodeType !== 8 && elem.nodeName == 'A' && is_return_data ){

        	var value = extractTextWithWhitespace(elem.childNodes, is_return_data);;
        	ret += '<a href="'+value.substring(0,value.length)+'">'+value+'</a>';
        }

        if (elem.nodeName === lineBreakNodeName)
        {
            ret += "\n";
        }
    }

    return ret;
}
// Cribbed from jQuery 1.4.2 (getText) and modified to retain whitespace
Cribbed from jQuery 1.4.2 (getText) and modified to retain whitespace
Cribbed from jQuery 1 . 4 . 2 ( getText ) and modified to retain whitespace
function extractTextWithWhitespaceWorker(elems, lineBreakNodeName,is_return_data)
{
    var ret = "";
    var elem;
    for (var i = 0; elems[i]; i++)
    {
        elem = elems[i];
        if (elem.nodeType === 3     
            || elem.nodeType === 4) 
        {
        	if(elem.data.length > 0){
            	ret += elem.nodeValue;
        	}
        }
        if ((elem.nodeType !== 8 && !is_return_data ) || (elem.nodeType !== 8 && elem.nodeName != 'A')) 
        {
            ret += extractTextWithWhitespace(elem.childNodes, is_return_data);
        } else if( elem.nodeType !== 8 && elem.nodeName == 'A' && is_return_data ){
        	var value = extractTextWithWhitespace(elem.childNodes, is_return_data);;
        	ret += '<a href="'+value.substring(0,value.length)+'">'+value+'</a>';
        }
        if (elem.nodeName === lineBreakNodeName)
        {
            ret += "\n";
        }
    }
    return ret;
}
function extractTextWithWhitespaceWorker ( elems , lineBreakNodeName , is_return_data ) { var ret = "" ; var elem ; for ( var i = 0 ; elems [ i ] ; i ++ ) { elem = elems [ i ] ; if ( elem . nodeType === 3 || elem . nodeType === 4 ) { if ( elem . data . length > 0 ) { ret += elem . nodeValue ; } } if ( ( elem . nodeType !== 8 && ! is_return_data ) || ( elem . nodeType !== 8 && elem . nodeName != 'A' ) ) { ret += extractTextWithWhitespace ( elem . childNodes , is_return_data ) ; } else if ( elem . nodeType !== 8 && elem . nodeName == 'A' && is_return_data ) { var value = extractTextWithWhitespace ( elem . childNodes , is_return_data ) ; ; ret += '<a href="' + value . substring ( 0 , value . length ) + '">' + value + '</a>' ; } if ( elem . nodeName === lineBreakNodeName ) { ret += "\n" ; } } return ret ; }
Cribbed from jQuery 1.4.2 (getText) and modified to retain whitespace
Cribbed from jQuery 1 . 4 . 2 ( getText ) and modified to retain whitespace
// text node // CDATA node // comment node