src/downshow.js
function getContent(node) {
    var text = '', atom;
    for (var i = 0; i<node.childNodes.length; i++) {
      if (node.childNodes[i].nodeType === 1) {
        atom = node.childNodes[i]._bfs_text;
      } else if (node.childNodes[i].nodeType === 3) {
        atom = node.childNodes[i].data;
      } else
        continue;
      if (text.match(/[\t ]+$/) && atom.match(/^[\t ]+/)) {
        text = text.replace(/[\t ]+$/,'') + ' ' + atom.replace(/^[\t ]+/, '');
      } else {
        text = text + atom;
      }
    }
    return text;
  }
function getContent(node) {
    var text = '', atom;
    for (var i = 0; i<node.childNodes.length; i++) {
      if (node.childNodes[i].nodeType === 1) {
        atom = node.childNodes[i]._bfs_text;
      } else if (node.childNodes[i].nodeType === 3) {
        atom = node.childNodes[i].data;
      } else
        continue;
      if (text.match(/[\t ]+$/) && atom.match(/^[\t ]+/)) {
        text = text.replace(/[\t ]+$/,'') + ' ' + atom.replace(/^[\t ]+/, '');
      } else {
        text = text + atom;
      }
    }
    return text;
  }
function getContent ( node ) { var text = '' , atom ; for ( var i = 0 ; i < node . childNodes . length ; i ++ ) { if ( node . childNodes [ i ] . nodeType === 1 ) { atom = node . childNodes [ i ] . _bfs_text ; } else if ( node . childNodes [ i ] . nodeType === 3 ) { atom = node . childNodes [ i ] . data ; } else continue ; if ( text . match ( / [\t ]+$ / ) && atom . match ( / ^[\t ]+ / ) ) { text = text . replace ( / [\t ]+$ / , '' ) + ' ' + atom . replace ( / ^[\t ]+ / , '' ) ; } else { text = text + atom ; } } return text ; }
Get a node's content.
Get a node s content .