MCPcopy Index your code
hub / github.com/node-js-libs/node.io / fulltext

Function fulltext

lib/node.io/dom.js:398–415  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

396 };
397
398 var fulltext = function (elem) {
399 var text = '';
400 if (elem.children && elem.children.length > 0) {
401 for (var i = 0, l = elem.children.length; i < l; i++) {
402 if (elem.children[i].type === 'text') {
403 text += elem.children[i].data.trim();
404 } else if (elem.children[i].name === 'br') {
405 text += '\n';
406 } else if (elem.children[i].type === 'tag') {
407 text += fulltext(elem.children[i]);
408 }
409 }
410 }
411
412 text = self.filter(text).entityDecode();
413
414 return text;
415 };
416
417 var innerHTML = function (elem) {
418 var text;

Callers 1

dom.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected