vsch: modified to accumulate text of all children
552440
public boolean wrapInAnchor() {
        if (ext(ANCHORLINKS | EXTANCHORLINKS)) {
            SuperNode node = (SuperNode) peek();
            List<Node> children = node.getChildren();
            if (ext(EXTANCHORLINKS)) {
                if (children.size() > 0) {
                    AnchorNodeInfo nodeInfo = new AnchorNodeInfo();
                    collectChildrensText(node, nodeInfo);
                    String text = nodeInfo.text.toString().trim();
                    if (text.length() > 0) {
                        AnchorLinkNode anchor = new AnchorLinkNode(text, "");
                        anchor.setStartIndex(nodeInfo.startIndex);
                        anchor.setEndIndex(nodeInfo.endIndex);
                        children.add(0, anchor);
                    }
                }
            } else {
                if (children.size() == 1) {
                    Node child = children.get(0);
                    if (child instanceof TextNode) {
                        AnchorLinkNode anchor = new AnchorLinkNode(((TextNode) child).getText());
                        anchor.setStartIndex(child.getStartIndex());
                        anchor.setEndIndex(child.getEndIndex());
                        children.set(0, anchor);
                    }
                }
            }
        }

        return true;
    }
1184313
function all(config, parent) {
  var children = parent.children
  var length = children && children.length
  var index = -1
  var result = []
  var child
  var node
  var pos
  var prevEndLine
  var prevOffset
  var endLine

  while (++index < length) {
    node = children[index]
    pos = node.position
    endLine = position.start(node).line

    if (prevEndLine && endLine !== prevEndLine) {
      child = config.parser.tokenizeWhiteSpace(
        repeat(newline, endLine - prevEndLine)
      )
      patch(config, [child], prevOffset)

      if (child.value.length < 2) {
        child.value = repeat(newline, 2)
      }

      result.push(child)
    }

    child = one(config, node)

    if (child) {
      result = result.concat(child)
    }

    pos = position.end(node)
    prevEndLine = pos.line
    prevOffset = pos.offset
  }

  return result
}
1121698
def iter_child_nodes(node):
    """"""
    for name, field in iter_fields(node):
        if isinstance(field, AST):
            yield field
        elif isinstance(field, list):
            for item in field:
                if isinstance(item, AST):
                    yield item
741887
function(node, text) {
                if (!(node instanceof kityminder.Node)) {
                    return;
                }
                var children = [], jsonMap = {}, level = 0;
                var LINE_SPLITTER = /\r|\n|\r\n/, TAB_REGEXP = /^(\t|\x20{4})/;
                var lines = text.split(LINE_SPLITTER), line = "", jsonNode, i = 0;
                var minder = this;
                function isEmpty(line) {
                    return line === "" && !/\S/.test(line);
                }
                function getNode(line) {
                    return {
                        data: {
                            text: line.replace(/^(\t|\x20{4})+/, "").replace(/(\t|\x20{4})+$/, "")
                        },
                        children: []
                    };
                }
                function getLevel(text) {
                    var level = 0;
                    while (TAB_REGEXP.test(text)) {
                        text = text.replace(TAB_REGEXP, "");
                        level++;
                    }
                    return level;
                }
                function addChild(parent, node) {
                    parent.children.push(node);
                }
                function importChildren(node, children) {
                    for (var i = 0, l = children.length; i < l; i++) {
                        var childNode = minder.createNode(null, node);
                        childNode.setData("text", children[i].data.text || "");
                        importChildren(childNode, children[i].children);
                    }
                }
                while ((line = lines[i++]) !== undefined) {
                    line = line.replace(/&nbsp;/g, "");
                    if (isEmpty(line)) continue;
                    level = getLevel(line);
                    jsonNode = getNode(line);
                    if (level === 0) {
                        jsonMap = {};
                        children.push(jsonNode);
                        jsonMap[0] = children[children.length - 1];
                    } else {
                        if (!jsonMap[level - 1]) {
                            throw new Error("Invalid local format");
                        }
                        addChild(jsonMap[level - 1], jsonNode);
                        jsonMap[level] = jsonNode;
                    }
                }
                importChildren(node, children);
                minder.refresh();
            }
867394
def _render_children(self, contexts, partials):
        """"""
        ret = []
        for child in self.children:
            ret.append(child._render(contexts, partials))
        return EMPTYSTRING.join(ret)
605365
function all(schema, children, node, stack) {
    var nodes = children || []
    var length = nodes.length || 0
    var results = []
    var index = -1
    var result

    stack = stack.concat(node.tagName)

    while (++index < length) {
        result = one(schema, nodes[index], stack)

        if (result) {
            if ('length' in result) {
                results = results.concat(result)
            } else {
                results.push(result)
            }
        }
    }

    return results
}
79069
function processKeywords() {
    var nodes = []
    var lastIndex
    var keyword
    var node
    var submatch

    if (!top.keywords) {
      return addText(modeBuffer, nodes)
    }

    lastIndex = 0

    top.lexemesRe.lastIndex = 0

    keyword = top.lexemesRe.exec(modeBuffer)

    while (keyword) {
      addText(modeBuffer.substring(lastIndex, keyword.index), nodes)

      submatch = keywordMatch(top, keyword)

      if (submatch) {
        relevance += submatch[1]

        node = build(submatch[0], [])

        nodes.push(node)

        addText(keyword[0], node.children)
      } else {
        addText(keyword[0], nodes)
      }

      lastIndex = top.lexemesRe.lastIndex
      keyword = top.lexemesRe.exec(modeBuffer)
    }

    addText(modeBuffer.substr(lastIndex), nodes)

    return nodes
  }
463132
function tree (toc, tpl) {
  if ( tpl === void 0 ) tpl = '';

  if (!toc || !toc.length) { return '' }

  toc.forEach(function (node) {
    tpl += "<li><a class=\"section-link\" href=\"" + (node.slug) + "\">" + (node.title) + "</a></li>";
    if (node.children) {
      tpl += "<li><ul class=\"children\">" + (tree(node.children)) + "</li></ul>";
    }
  });

  return tpl
}
31708
function eachNode(src, callback) {
        var index = 0;
        var text, range, length, payload;
        while (index < src.length) {

            // find the next tag
            range = _findTag(src, index);
            if (!range) {
                range = { from: src.length, length: 0 };
            }

            // add the text before the tag
            length = range.from - index;
            if (length > 0) {
                text = src.substr(index, length);
                if (/\S/.test(text)) {
                    payload = extractPayload(text);
                    payload.sourceOffset = index;
                    payload.sourceLength = length;
                    callback(payload);
                }
            }

            // add the tag
            if (range.length > 0) {
                payload = extractPayload(src.substr(range.from, range.length));
                payload.sourceOffset = range.from;
                payload.sourceLength = range.length;
                callback(payload);
            }

            // advance
            index = range.from + range.length;
        }
    }
1033024
def tree_text(node):
    
    text = []
    for descendant in walk_dom(node):
        if is_text(descendant):
            text.append(descendant.nodeValue)
    return ' '.join(text)
388464
def pad(lines, delim):
	
	"""
	Populates text into chunks. If the delim was & then
	['12 & 344', '344 & 8', '8 & 88'] would be stored in chunks as
	[['12', '344', '8'], ['344', '8', '88']]
	"""
	chunks = []
	for i in range(len(lines)):
		line = lines[i]
		sections = line.split(delim)
		for j in range(len(sections)):
			if len(chunks) <= j:
				chunks.append([])
			chunks[j].append(sections[j])

	"""
	Calculates & Stores the max length of chunks
	"""
	max_lengths = []
	for i in range(len(chunks)):
		_max = max([len(j) for j in chunks[i]])
		max_lengths.append(_max)

	"""
	Pads the children of chunks according to the chunk's max length" \
	"""
	for i in range(len(chunks)):
		for j in range(len(chunks[i])):
			chunks[i][j] += (max_lengths[i] - len(chunks[i][j])) * ' '
	new_lines = ['' for i in range(len(lines))]

	for i in range(len(chunks)):
		for j in range(len(chunks[i])):
			new_lines[j] += chunks[i][j]
	return new_lines
457102
def transformChildrenToNative(self):
        
        for childArray in (self.contents[k] for k in self.sortChildKeys()):
            for child in childArray:
                child = child.transformToNative()
                child.transformChildrenToNative()
229508
def populate_tree(self, parentItem, children_list):
        """"""
        for child_key in children_list:
            self.item_depth += 1
            (filename, line_number, function_name, file_and_line, node_type
             ) = self.function_info(child_key)

            ((total_calls, total_calls_dif), (loc_time, loc_time_dif), (cum_time,
             cum_time_dif)) = self.format_output(child_key)

            child_item = TreeWidgetItem(parentItem)
            self.item_list.append(child_item)
            self.set_item_data(child_item, filename, line_number)

            # FIXME: indexes to data should be defined by a dictionary on init
            child_item.setToolTip(0, _('Function or module name'))
            child_item.setData(0, Qt.DisplayRole, function_name)
            child_item.setIcon(0, self.icon_list[node_type])

            child_item.setToolTip(1, _('Time in function '\
                                       '(including sub-functions)'))
            child_item.setData(1, Qt.DisplayRole, cum_time)
            child_item.setTextAlignment(1, Qt.AlignRight)
            
            child_item.setData(2, Qt.DisplayRole, cum_time_dif[0])
            child_item.setForeground(2, QColor(cum_time_dif[1]))
            child_item.setTextAlignment(2, Qt.AlignLeft)

            child_item.setToolTip(3, _('Local time in function '\
                                      '(not in sub-functions)'))

            child_item.setData(3, Qt.DisplayRole, loc_time)
            child_item.setTextAlignment(3, Qt.AlignRight)
            
            child_item.setData(4, Qt.DisplayRole, loc_time_dif[0])
            child_item.setForeground(4, QColor(loc_time_dif[1]))
            child_item.setTextAlignment(4, Qt.AlignLeft)

            child_item.setToolTip(5, _('Total number of calls '\
                                       '(including recursion)'))

            child_item.setData(5, Qt.DisplayRole, total_calls)
            child_item.setTextAlignment(5, Qt.AlignRight)
            
            child_item.setData(6, Qt.DisplayRole, total_calls_dif[0])
            child_item.setForeground(6, QColor(total_calls_dif[1]))
            child_item.setTextAlignment(6, Qt.AlignLeft)

            child_item.setToolTip(7, _('File:line '\
                                       'where function is defined'))
            child_item.setData(7, Qt.DisplayRole, file_and_line)
            #child_item.setExpanded(True)
            if self.is_recursive(child_item):
                child_item.setData(7, Qt.DisplayRole, '(%s)' % _('recursion'))
                child_item.setDisabled(True)
            else:
                callees = self.find_callees(child_key)
                if self.item_depth < 3:
                    self.populate_tree(child_item, callees)
                elif callees:
                    child_item.setChildIndicatorPolicy(child_item.ShowIndicator)
                    self.items_to_be_shown[id(child_item)] = callees
            self.item_depth -= 1
1070208
function cleanChildren(array) {
    if (!Array.isArray(array)) {
        return array;
    }
    return array.map(function(el) {
        if (el.type == "#text") {
            return el.children;
        } else {
            return {
                type: el.type,
                props: el.props,
                children: cleanChildren(el.children),
            };
        }
    });
}
496603
def _process_all_1(self, texts:Collection[str]) -> List[List[str]]:
        ""
        tok = self.tok_func(self.lang)
        if self.special_cases: tok.add_special_cases(self.special_cases)
        return [self.process_text(str(t), tok) for t in texts]
957961
function all(tree, file, config) {
  var ignore = config.ignore
  var ignoreLiteral = config.ignoreLiteral
  var ignoreDigits = config.ignoreDigits
  var apos = config.normalizeApostrophes
  var checker = config.checker
  var cache = config.cache

  visit(tree, 'WordNode', checkWord)

  // Check one word.
  function checkWord(node, position, parent) {
    var children = node.children
    var word = toString(node)
    var correct
    var length
    var index
    var child
    var reason
    var message
    var suggestions

    if (ignoreLiteral && isLiteral(parent, position)) {
      return
    }

    if (apos) {
      word = word.replace(smart, straight)
    }

    if (irrelevant(word)) {
      return
    }

    correct = checker.correct(word)

    if (!correct && children.length > 1) {
      correct = true
      length = children.length
      index = -1

      while (++index < length) {
        child = children[index]

        if (child.type !== 'TextNode' || irrelevant(child.value)) {
          continue
        }

        if (!checker.correct(child.value)) {
          correct = false
        }
      }
    }

    if (!correct) {
      if (own.call(cache, word)) {
        reason = cache[word]
      } else {
        reason = quote(word, '`') + ' is misspelt'

        if (config.count === config.max) {
          message = file.message(
            'Too many misspellings; no further spell suggestions are given',
            node,
            'overflow'
          )

          message.source = source
        }

        config.count++

        if (config.count < config.max) {
          suggestions = checker.suggest(word)

          if (suggestions.length !== 0) {
            reason +=
              '; did you mean ' + quote(suggestions, '`').join(', ') + '?'
            cache[word] = reason
          }
        }

        cache[word] = reason
      }

      message = file.message(reason, node, source)
      message.source = source
      message.actual = word
      message.expected = suggestions
    }
  }

  // Check if a word is irrelevant.
  function irrelevant(word) {
    return includes(ignore, word) || (ignoreDigits && digitsOnly.test(word))
  }
}
1228501
function( s ){

    if( s.match(/\./ ) ){

      var l = s.split( /\./ );
      for( var i = 0; i < l.length-1; i++ ){
        l[ i ] = '_children.' + l[ i ];
      }
      return l.join( '.' );

    } else {
      return s;
    }
  }