Creates an anchor link

 @param body [String] body of the link
 @param location [String] location of the anchor

 @return [String] anchor to a particular location of the current page
967147
def anchor_to(body, location)
      current_path = url_for(only_path: false)
      path = "#{current_path}##{location}"

      link_to body, path
    end
832830
def _create_popup_window(title, body):
    
    assert isinstance(title, six.text_type)
    assert isinstance(body, Container)
    return Frame(body=body, title=title)
1106949
function LocationUrl(url, pathPrefix, appBaseUrl) {
  pathPrefix = pathPrefix || '';

  /**
   * Parse given html5 (regular) url string into properties
   * @param {string} newAbsoluteUrl HTML5 url
   * @private
   */
  this.$$parse = function(newAbsoluteUrl) {
    var match = matchUrl(newAbsoluteUrl, this);

    if (match.path.indexOf(pathPrefix) !== 0) {
      throw Error('Invalid url "' + newAbsoluteUrl + '", missing path prefix "' + pathPrefix + '" !');
    }

    this.$$path = decodeURIComponent(match.path.substr(pathPrefix.length));
    this.$$search = parseKeyValue(match.search);
    this.$$hash = match.hash && decodeURIComponent(match.hash) || '';

    this.$$compose();
  };

  /**
   * Compose url and update `absUrl` property
   * @private
   */
  this.$$compose = function() {
    var search = toKeyValue(this.$$search),
        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';

    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
    this.$$absUrl = composeProtocolHostPort(this.$$protocol, this.$$host, this.$$port) +
                    pathPrefix + this.$$url;
  };


  this.$$rewriteAppUrl = function(absoluteLinkUrl) {
    if(absoluteLinkUrl.indexOf(appBaseUrl) == 0) {
      return absoluteLinkUrl;
    }
  }


  this.$$parse(url);
}
810177
def generate_page_link page_number
      url = core__add_param_to_url(@args[:url], @args[:param], page_number)
      if @args[:extra_params]
        @args[:extra_params].each do |key, value|
          url = core__add_param_to_url(url, key, value)
        end
      end
      url
    end
738731
function() {
        var separator = this.anchor ? '#' : '?';
        var href = this.base;
        var anchor = null;
        if (href.indexOf("#") != -1 && this.anchor == false) {
            anchor = href.substring( href.indexOf("#"), href.length);
        }
        if (href.indexOf(separator) != -1) {
            href = href.substring( 0, href.indexOf(separator) );
        }
        var splits = href.split("#");
        href = splits[0] + separator+ OpenLayers.Util.getParameterString(this.createParams());
        if (anchor) {
            href += anchor;
        }
        if (this.anchor && !this.element) {
            window.location.href = href;
        }
        else {
            this.element.href = href;
        }
    }
887751
def create_tab(self, location=None):
        
        eb = self._get_or_create_editor_buffer(location)

        self.tab_pages.insert(self.active_tab_index + 1, TabPage(Window(eb)))
        self.active_tab_index += 1
23204
def make_absolute_url(url)
      return url unless URI.parse(url).relative?
      begin
        URI.parse(@page_url).merge(url).to_s
      rescue URI::Error
        url
      end
    end
1371823
def page_url(url)
      define_method("goto") do
        platform.navigate_to self.page_url_value
      end

      define_method('page_url_value') do
        lookup = url.kind_of?(Symbol) ? self.send(url) : url
        erb = ERB.new(%Q{#{lookup}})
        merged_params = self.class.instance_variable_get("@merged_params")
        params = merged_params ? merged_params : self.class.params
        erb.result(binding)
      end
    end
671449
def addLocation(self, locationUri, weight):
        
        assert isinstance(weight, (float, int)), "weight value has to be a positive or negative integer"
        self.topicPage["locations"].append({"uri": locationUri, "wgt": weight})
405584
def parse_email_for_anchor_text_link(email, link_text)
      if email.multipart?
        body = email.html_part.body
      else
        body = email.body
      end
      if match_data = body.match(%r{<a[^>]*href=['"]?([^'"]*)['"]?[^>]*?>[^<]*?#{link_text}[^<]*?</a>})
        match_data[1]
      end
    end
1313452
async function _createSite() {
  const endpoint = url.resolve(apiURL, '/sites');
  const response = await got.post(endpoint, { json: true, headers: _bearer() });

  return response.body.site.id;
}
356661
def anchor
      name, anchor_mark = @data.split(/,\s*/o, 2)
      anchor_mark = "_" if (anchor_mark.nil? or anchor_mark.empty?)
      HtmlElement.create("a", anchor_mark,
                         "name" => name,
                         "href" => "#" + name)
    end
837921
def make_url_absolute(self, url, resolve_base=False):
        

        if self.config['url']:
            if resolve_base:
                ubody = self.doc.unicode_body()
                base_url = find_base_url(ubody)
                if base_url:
                    return urljoin(base_url, url)
            return urljoin(self.config['url'], url)
        else:
            return url
45516
function linkEntity (cls, url, text) {
  return dom.create('div')
    .class(cls)
    .add(dom.create('a').attr('href', url).add(text))
}
351395
def remote_link_to(name, url, options = {}, &block)
      options[:href] ||= url
      Effective::FormInputs::RemoteLinkTo.new(name, options, builder: self).to_html(&block)
    end
1245354
function createFrame (bodyContent, callbackId, callback) {
    var Proto = function Frame () {},
        api = new Proto(),
        domElement = scope.document.createElement('iframe');

    domElement.id = 'OTPlugin_frame_' + $.uuid().replace(/\-+/g, '');
    domElement.style.border = '0';

    try {
      domElement.style.backgroundColor = 'rgba(0,0,0,0)';
    } catch (err) {
      // Old IE browsers don't support rgba
      domElement.style.backgroundColor = 'transparent';
      domElement.setAttribute('allowTransparency', 'true');
    }

    domElement.scrolling = 'no';
    domElement.setAttribute('scrolling', 'no');

    // This is necessary for IE, as it will not inherit it's doctype from
    // the parent frame.
    var frameContent = '<!DOCTYPE html><html><head>' +
                      '<meta http-equiv="x-ua-compatible" content="IE=Edge">' +
                      '<meta http-equiv="Content-type" content="text/html; charset=utf-8">' +
                      '<title></title></head><body>' +
                      bodyContent +
                      '<script>window.parent["' + callbackId + '"](' +
                        'document.querySelector("object")' +
                      ');</script></body></html>';

    var wrappedCallback = function() {
      OTPlugin.log('LOADED IFRAME');
      var doc = domElement.contentDocument || domElement.contentWindow.document;

      if ($.env.iframeNeedsLoad) {
        doc.body.style.backgroundColor = 'transparent';
        doc.body.style.border = 'none';

        if ($.env.name !== 'IE') {
          // Skip this for IE as we use the bookmarklet workaround
          // for THAT browser.
          doc.open();
          doc.write(frameContent);
          doc.close();
        }
      }

      if (callback) {
        callback(
          api,
          domElement.contentWindow,
          doc
        );
      }
    };

    scope.document.body.appendChild(domElement);

    if($.env.iframeNeedsLoad) {
      if ($.env.name === 'IE') {
        // This works around some issues with IE and document.write.
        // Basically this works by slightly abusing the bookmarklet/scriptlet
        // functionality that all browsers support.
        domElement.contentWindow.contents = frameContent;
        /*jshint scripturl:true*/
        domElement.src = 'javascript:window["contents"]';
        /*jshint scripturl:false*/
      }

      $.on(domElement, 'load', wrappedCallback);
    } else {
      setTimeout(wrappedCallback, 0);
    }

    api.reparent = function reparent (target) {
      // document.adoptNode(domElement);
      target.appendChild(domElement);
    };

    api.element = domElement;

    return api;
  }
287217
function(body) {
    var $     = cheerio.load(body),
        page  = {};

    // Meta signals
    page.title = $('title').text() || null;
    page.description = $('meta[name=description]').attr('content') || null;
    page.author = $('meta[name=author]').attr('content') || null;
    page.keywords = $('meta[name=keywords]').attr('content') || null;

    // Heading signals
    var h1s = 0;
    $('h1').each(function() {
      h1s++;
    });
    page.heading1 = $('body h1:first-child').text().trim().replace('\n', '');
    page.totalHeadings = h1s;

    // Accessibility signals
    var totalImgs       = 0,
        accessibleImgs  = 0;
    $('img').each(function(index) {
      totalImgs++;
      if ($(this).attr('alt') || $(this).attr('title')) {
        accessibleImgs++;
      }
    });
    page.imgAccessibility = (accessibleImgs / totalImgs) * 100;
    return page;
  }