Create an encoded href for an attribute meta
183860
public static String concatMetaAttributeHref(
      String baseUri, String entityParentName, String attributeName) {
    return String.format(
        "%s/%s/meta/%s",
        baseUri, encodePathSegment(entityParentName), encodePathSegment(attributeName));
  }
953304
def charset_from_meta_content(string)

      charset_match = string.match(/charset\s*\=\s*(.+)/i)

      if charset_match

        charset_value = charset_match[1]

        charset_value[/\A\"(.*)\"/, 1] ||
        charset_value[/\A\'(.*)\'/, 1] ||
        charset_value[/(.*)[\s;]/, 1] ||
        charset_value[/(.*)/, 1]
      else
        nil
      end

    end
981278
def Encode(self, attribute, value):
    """"""
    required_type = self._attribute_types.get(attribute, "bytes")

    if required_type == "integer":
      return rdf_structs.SignedVarintEncode(int(value))
    elif required_type == "unsigned_integer":
      return rdf_structs.VarintEncode(int(value))
    elif hasattr(value, "SerializeToString"):
      return value.SerializeToString()
    elif isinstance(value, bytes):
      return value
    elif isinstance(value, Text):
      return value.encode("utf-8")
    else:
      return str(value).encode("utf-8")
870322
def parse_meta(content, meta_name, source_descr, content_attr_name="content"):
    
    dom = dhtmlparser.parseString(content)

    meta_tags = dom.find(
        "meta",
        fn=lambda x: x.params.get("name", "").lower() == meta_name.lower()
    )

    return [
        SourceString(tag.params[content_attr_name], source_descr)
        for tag in meta_tags
        if content_attr_name in tag.params
    ]
274014
function createNormalRu( $rb, $rt, attr ) {
  var $ru = $.create( 'h-ru' )
  var $rt = $.clone( $rt )
  var attr = attr || {}
  attr.annotation = 'true'

  if ( Array.isArray( $rb )) {
    $ru.innerHTML = $rb.map(function( rb ) {
      if ( typeof rb === 'undefined' )  return ''
      return rb.outerHTML
    }).join('') + $rt.outerHTML
  } else {
    $ru.appendChild( $.clone( $rb ))
    $ru.appendChild( $rt )
  }

  $.setAttr( $ru, attr )
  return $ru
}
893089
function htmlTagObjectToString (tagDefinition, xhtml) {
  const attributes = Object.keys(tagDefinition.attributes || {})
    .filter(function (attributeName) {
      return tagDefinition.attributes[attributeName] !== false;
    })
    .map(function (attributeName) {
      if (tagDefinition.attributes[attributeName] === true) {
        return xhtml ? attributeName + '="' + attributeName + '"' : attributeName;
      }
      return attributeName + '="' + tagDefinition.attributes[attributeName] + '"';
    });
  return '<' + [tagDefinition.tagName].concat(attributes).join(' ') + (tagDefinition.voidTag && xhtml ? '/' : '') + '>' +
    (tagDefinition.innerHTML || '') +
    (tagDefinition.voidTag ? '' : '</' + tagDefinition.tagName + '>');
}
626327
def htmlSetMetaEncoding(self, encoding):
        
        ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
        return ret
1007886
def _make_links_absolute(html, base_url):
    
    url_changes = []

    soup = BeautifulSoup(html)
    for tag in soup.find_all('a', href=True):
        old = tag['href']
        fixed = urljoin(base_url, old)
        if old != fixed:
            url_changes.append((old, fixed))
            tag['href'] = fixed

    for tag in soup.find_all('img', src=True):
        old = tag['src']
        fixed = urljoin(base_url, old)
        if old != fixed:
            url_changes.append((old, fixed))
            tag['src'] = fixed

    return mark_safe(six.text_type(soup)), url_changes
1054855
function makeLink(rel, ldo) {
  var i, key, keys, result;

  if (typeof ldo === 'string') {
    return '<' + ldo + '>; rel="' + rel + '"';
  }

  result = '<' + ldo.href + '>; rel="' + rel + '"';
  keys = Object.keys(ldo);

  for (i = 0; i < keys.length; i += 1) {
    key = keys[i];

    if (key !== 'href' && key !== 'rel') {
      result += '; ' + key + '="' + ldo[key] + '"';
    }
  }

  return result;
}
199850
function(attr) {
        var html = this._escapedAttributes[attr];
        if (html) {
          return html;
        }
        var val = this.attributes[attr];
        var escaped;
        if (isNullOrUndefined(val)) {
          escaped = '';
        } else {
          escaped = _.escape(val.toString());
        }
        this._escapedAttributes[attr] = escaped;
        return escaped;
      }
82212
public static Attribute<HtmlTag> meta( String name, String value )
    {
        return head( "meta", ignored ->
        {
        }, new Attribute<Void>()
        {
            @Override
            public String name()
            {
                return name;
            }

            @Override
            public String value( Void target )
            {
                return value;
            }
        } );
    }
538959
function createSite(refInfo) {
  let url = parseUrl(refInfo.referer);
  let result = {
    'domain': url.hostname,
    'page': url.protocol + '://' + url.hostname + url.pathname
  };
  if (self === top && document.referrer) {
    result.ref = document.referrer;
  }
  let keywords = document.getElementsByTagName('meta')['keywords'];
  if (keywords && keywords.content) {
    result.keywords = keywords.content;
  }
  return result;
}
318339
def get_absolute_url_link(self, text=None, cls=None, icon_class=None,
                              **attrs):
        """"""
        if text is None:
            text = self.get_link_text()

        return build_link(href=self.get_absolute_url(),
                          text=text,
                          cls=cls,
                          icon_class=icon_class,
                          **attrs)
1359081
function findMetaTag(attribute, regExp = /.*/) {
  let metas = document.querySelectorAll(`meta[${attribute}]`);
  for (let i = 0; i < metas.length; i++) {
    let match = metas[i].getAttribute(attribute).match(regExp);
    if (match) {
      return metas[i];
    }
  }
  return null;
}
1321907
def element_href_use_wildcard(name):
    
    if name:
        element = fetch_meta_by_name(name, exact_match=False)
        return element.json
624178
function( HTMLCode ){
        var $ = cheerio.load( HTMLCode, { decodeEntities: false } );

        _.forEach(
            {
                a: "href",
                img: "src",
                link: "href",
                script: "src"
            },
            function( attr, tagName ){
                $( tagName + "[" + attr + "]" ).each( function( index, elm ){
                    var testValue = $( elm ).attr( attr );
                    if( testValue.match( /^(#|\/|http:\/\/|https:\/\/|tel:|mailto:)/ ) ){ return; }
                    $( elm ).attr( attr, "<%- __normalizePath__( \"" + this.convertResourcePathAbsolute( testValue ).replace( /\\/g, "\\\\" ) + "\" ) %>" );
                }.bind( this ) );
            },
            this
        );

        return $.html();
    }
1296755
function(org) {
        var url = decodeURIComponent(org.toString());
        urlOutput.empty().attr('href', url);

        url = url.replace(/.*?\/users\//g, '/users/');
        url = url.replace(/Token=(.{10}).*/g, 'Token=$1...');

        var parts = url.split('?'), param;
        var params = parts[1].replace(/t\[\]=maxSize.*?&/g, '').split('&');

        // Base url
        $('<div />').text(parts[0]).appendTo(urlOutput);
        for (var i = 0, prefix; i < params.length; i++) {
            prefix = i > 0 ? '&' : '?';

            parts = params[i].split(/t\[\]=/);
            param = prefix + parts[0];
            if (parts.length > 1) {
                var args = [], trans = parts[1].split(':');
                param = prefix + 't[]=<span class="transformation">' + trans[0] + '</span>';

                if (trans.length > 1) {
                    var items = trans[1].split(',');

                    for (var t = 0; t < items.length; t++) {
                        var c = items[t].split('='), x = '';
                        x += '<span class="param">' + c[0] + '</span>=';
                        x += '<span class="value">' + c[1] + '</span>';
                        args.push(x);
                    }

                    param += ':' + args.join(',');
                }
            }

            param = param.replace(/(.*?=)/, '<strong>$1</strong>');
            $('<div />').html(param).appendTo(urlOutput);
        }
    }