Parses and adds block of links
494589
def _add_links(self, links, key="href", proxy_key="proxyURL", endpoints=None):
        
        if endpoints is None:
            endpoints = ["likes", "replies", "shares", "self", "followers",
                         "following", "lists", "favorites", "members"]

        if links.get("links"):
            for endpoint in links['links']:
                # It would seem occasionally the links["links"][endpoint] is
                # just a string (what would be the href value). I don't know
                # why, it's likely a bug in pump.io but for now we'll support
                # this too.
                if isinstance(links['links'][endpoint], dict):
                    self._add_link(endpoint, links['links'][endpoint]["href"])
                else:
                    self._add_link(endpoint, links["links"][endpoint])

        for endpoint in endpoints:
            if links.get(endpoint, None) is None:
                continue

            if "pump_io" in links[endpoint]:
                self._add_link(endpoint, links[endpoint]["pump_io"][proxy_key])
            elif "url" in links[endpoint]:
                self._add_link(endpoint, links[endpoint]["url"])
            else:
                self._add_link(endpoint, links[endpoint][key])

        return self.links
978949
def add_link(name, url)
      set_field(LINKS_META, []) if fields[LINKS_META].nil?
      fields[LINKS_META] << {'name' => name, 'url' => url}
    end
1308839
function makeLinks (links, item) {
  var retLinks = {}

  _.each(links, function (value, name) {
    if (_.isFunction(value)) {
      retLinks[name] = value(item)
    } else {
      retLinks[name] = _(value).toString()
    }
  })

  return retLinks
}
642345
def parse_href(href):
    """"""
    url = urlparse(href)
    path = url.path.split('/')
    collection_name = path[1]
    id_ = path[2]
    return collection_name, id_
34298
function prepareLinks(response, rootUrl, queryPath) {
  var selfLink = { "href": rootUrl + queryPath };
  response._links = {};
  response._links.self = selfLink;
}
755442
function fixAnchors (hook) {

  hook.afterEach(function (html, next) {

    // find all headings and replace them
    html = html.replace(/<(h\d).+?<\/\1>/g, function (html) {

      // create temp node
      var div = document.createElement('div')
      div.innerHTML = html

      // get anchor
      var link = div.querySelector('a[href*="?id"]')

      if (!link) {
        return html
      }

      // work out id
      var text = link.innerText
      var id = text
        .split('(')
        .shift()
        .toLowerCase()
        .replace(/\W+/g, '-')
        .replace(/^-+|-+$/g, '')
      var href = link.getAttribute('href')
        .replace(/\?id=.+/, '?id=' + id)

      // update dom
      link.setAttribute('href', href)
      link.setAttribute('data-id', id)
      link.parentElement.setAttribute('id', id)

      // return html
      return div.innerHTML
    })

    // continue
    next(html)
  })
}
220811
def parse_link_results(doc)
    uris = doc.xpath("/ds:links/ds:uri", @ds_namespaces)
    results = []
    uris.each do |uri_el|
      link = uri_el.content
      results << URI.parse(link)
    end
    results
  end
646728
def parse_link(self, node):
        

        if 'name' in node.lattrib:
            name = node.lattrib['name']
        else:
            self.raise_error('<Link> must specify a name')

        if 'type' in node.lattrib:
            type_ = node.lattrib['type']
        else:
            self.raise_error("Link '{0}' must specify a type", name)

        description = node.lattrib.get('description', '')

        self.current_component_type.add_link(Link(name, type_, description))
656754
function mergeLinks(child, index, parent) {
  var siblings = parent.children
  var nodes = [child]
  var start = index
  var end = index
  var currentIndex = index
  var value
  var type
  var initial
  var final

  if (!puncOrSymbol(child.type) || toString(child) !== '.') {
    return
  }

  // Find preceding word/punctuation. Stop before slashes, break after `www`.
  while (siblings[start - 1]) {
    type = siblings[start - 1].type

    if (!applicable(type)) {
      break
    }

    if (puncOrSymbol(type) && slashes.test(toString(siblings[start - 1]))) {
      break
    }

    start--

    nodes.unshift(siblings[start])

    if (type === 'WordNode' && toString(siblings[start]) === 'www') {
      break
    }
  }

  // Find following word/punctuation.
  while (siblings[end + 1]) {
    type = siblings[end + 1].type

    if (!applicable(type)) {
      break
    }

    end++
    nodes.push(siblings[end])
  }

  // This full stop doesnt look like a link:  it’s either not followed, or not
  // preceded, by words or punctuation.
  if (currentIndex === start || currentIndex === end) {
    return
  }

  // 1-3 slashes.
  if (
    start > 0 &&
    puncOrSymbol(siblings[start - 1].type) &&
    slashes.test(toString(siblings[start - 1]))
  ) {
    start--
    nodes.unshift(siblings[start])
  }

  // URL protocol and colon.
  if (
    start > 2 &&
    puncOrSymbol(siblings[start - 1].type) &&
    toString(siblings[start - 1]) === ':' &&
    siblings[start - 2].type === 'WordNode'
  ) {
    nodes.unshift(siblings[start - 2], siblings[start - 1])
    start -= 2
  }

  value = null

  // Remove the last node if it's punctuation, unless it's `/` or `)`.
  if (puncOrSymbol(siblings[end].type)) {
    value = toString(siblings[end])

    if (value !== '/' && value !== ')') {
      end--
      nodes.pop()
    }
  }

  child = {type: 'SourceNode', value: toString(nodes)}
  initial = position.start(nodes[0])
  final = position.end(nodes[nodes.length - 1])

  if (initial.line && final.line) {
    child.position = {start: initial, end: final}
  }

  // Remove the nodes and insert a SourceNode.
  siblings.splice(start, end - start + 1, child)

  index++

  // Ignore the following full-stop: it's not part of a link.
  if (value === '.') {
    index++
  }

  return index
}
867932
private String parseLink(final String link) {
		String[] tokens = link.substring(7, link.length() - 1).split("\\s");
		if (tokens.length == 1) {
			return tokens[0];
		}
		StringBuilder result = new StringBuilder();

		boolean parametersSeen = false;
		boolean inParameters = false;

		for (int index = 0; index < tokens.length; index++) {
			result.append(" ").append(tokens[index]);
			if (tokens[index].indexOf('(') != -1 && !parametersSeen) {
				inParameters = true;
			}
			if (index == 1 && !inParameters) {
				result = new StringBuilder(tokens[index]);
			}
			if (tokens[index].indexOf(')') != -1 && !parametersSeen) {
				parametersSeen = true;
				if (index != tokens.length - 1) {
					result = new StringBuilder();
				}

			}

		}

		return result.toString().trim();
	}
858068
function grab(url, content) {
  // make sure hrefs is an array even if is singleton
  var hrefsAsArray = _.isArray(content.hrefs) ? content.hrefs : [content.hrefs]
  return {
    url: url,
    content: _.omit(content, 'hrefs'),
    hrefs: hrefsAsArray,
    child: {}
  }
}
167512
def parse_links(json)
      links = json[:links] || json[:link] || json['links'] || json['link']
      return [] if links.nil?

      links = [links] unless links.is_a?(Array)
      links.map do |link|
        if (link[:href].nil? && link['href'].nil?) || (link[:rel].nil? && link['rel'].nil?)
          msg = "Invalid hash link: #{link.inspect}"
          raise(RuntimeError, msg, caller)
        end
        EntryPoint.new(link[:href] || link['href'], link[:rel] || link['rel'])
      end
    end
60069
def edit_link(link = nil, options = {}, &block)
      if link && link.is_a?(Instamojo::Link)
        yield(link) if block_given?
      else
        options = set_options(options, &block)
        link = Instamojo::Link.new(options, self)
      end
      patch("links/#{link.slug}", link.to_h)
      @response.success? ? Instamojo::Link.new(@response.body[:link], self) : @response
    end
817538
function parseLinks(target, resp) {
  target._links = parseLinkHeader(resp.headers.get('link'));
  target._linkTemplates = parseLinkHeader(resp.headers.get('link-template'));
  return resp
}
374585
def parse_links(args_link):
    
    links = []
    if (args_link is not None):
        for link_str in args_link:
            try:
                links.append(parse_link(link_str))
            except ClientFatalError as e:
                raise ClientFatalError(
                    "Bad --link option '%s' (%s)" %
                    (link_str, str(e)))
    return(links)
1086078
def _parse_book_links(dom):
    
    links = []
    picker = lambda x: x.params.get("class", "").startswith("boxProKnihy")

    for el in dom.find(None, fn=picker):
        book_ref = el.find("a")

        if not book_ref or "href" not in book_ref[0].params:
            continue

        links.append(book_ref[0].params["href"])

    return links
597514
protected function AddListLink($block)
	{
		$para = new XmlParagraphCollection();
		$this->_mainBlock->addXmlnukeObject($para);
		$this->url->addParam("action", ModuleAction::Listing);
		$link = new XmlAnchorCollection($this->url->getUrl(), "");
		$link->addXmlnukeObject(new XmlnukeText($this->myWords->Value("LINK_LISTROLES")));
		$para->addXmlnukeObject($link);
	}