function inferDescription (ast, description) {
  ast.children.some(function (node, index) {
    if (node.type == 'heading' && node.depth > 1) {
      return true;
    }

    var text = mdastToString(node);
    var prefix = text.slice(0, description.length);
    if (prefix.toLowerCase() == description.toLowerCase()) {
      description = text;
      ast.children.splice(index, 1);
      return true;
    }
  });

  return description;
}
/**
 * Find description in the first paragraph of the AST, return that and
 * remove corresponding nodes from the AST.
 *
 * Return the original description if not found.
 */
Find description in the first paragraph of the AST, return that and
remove corresponding nodes from the AST.

Return the original description if not found.
Find description in the first paragraph of the AST return that and remove corresponding nodes from the AST . Return the original description if not found .
function inferDescription (ast, description) {
  ast.children.some(function (node, index) {
    if (node.type == 'heading' && node.depth > 1) {
      return true;
    }
    var text = mdastToString(node);
    var prefix = text.slice(0, description.length);
    if (prefix.toLowerCase() == description.toLowerCase()) {
      description = text;
      ast.children.splice(index, 1);
      return true;
    }
  });
  return description;
}
function inferDescription ( ast , description ) { ast . children . some ( function ( node , index ) { if ( node . type == 'heading' && node . depth > 1 ) { return true ; } var text = mdastToString ( node ) ; var prefix = text . slice ( 0 , description . length ) ; if ( prefix . toLowerCase ( ) == description . toLowerCase ( ) ) { description = text ; ast . children . splice ( index , 1 ) ; return true ; } } ) ; return description ; }
Find description in the first paragraph of the AST, return that and
 remove corresponding nodes from the AST.
Find description in the first paragraph of the AST return that and remove corresponding nodes from the AST .