HTML tag helper.
486145
function writeTag(name, attrs, close, content) {
  var end = close ? '/>' : '>'
    , pairs = []
    , tag;

  for (var key in attrs) {
    pairs.push(key + '="' + escape(attrs[key]) + '"');
  }
  tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;

  if (content){
    tag += content + '</' + name + end;
  }
  return tag;
}
1351559
def string_tag(name, value):
    """"""
    return name.encode('utf-8') + \
        len(value).to_bytes(4, byteorder='big') + \
        value.encode('utf-8')
148493
def handle_starttag(self, tag, attrs):
        """"""
        if tag.lower() in self.allowed_tag_whitelist:
            if tag.lower() == 'ol':
                # we need a list to store the last
                # number used  in the previous ordered lists
                self.previous_nbs.append(self.nb)
                self.nb = 0
                # we need to know which is the tag list
                self.previous_type_lists.append(tag.lower())
                # we must remove any non-relevant spacing and end of
                # line before
                self.result = self.result.rstrip()
            elif tag.lower() == 'ul':
                self.previous_type_lists.append(tag.lower())
                # we must remove any non-relevant spacing and end of
                # line before
                self.result = self.result.rstrip()
            elif tag.lower() == 'li':
                # we must remove any non-relevant spacing and end of
                # line before
                self.result = self.result.rstrip()
                if self.previous_type_lists[-1] == 'ol':
                    self.nb += 1
                    self.result += '\n' + self.line_quotation + \
                                   '  ' * len(self.previous_type_lists) + \
                        str(self.nb) + '. '
                else:
                    self.result += '\n' + self.line_quotation + \
                                   '  ' * len(self.previous_type_lists) + '* '
            elif tag.lower() == 'a':
                # self.previous_type_lists.append(tag.lower())
                for (attr, value) in attrs:
                    if attr.lower() == 'href':
                        self.url = value
                        self.result += '<' + value + '>'
1138040
def tag_name(cls, tag):
        """"""
        while isinstance(tag, etree._Element):
            tag = tag.tag
        return tag.split('}')[-1]
943416
def text(self):
        """"""
        texts = []
        for child in self.childs:
            if isinstance(child, Tag):
                texts.append(child.text())
            elif isinstance(child, Content):
                texts.append(child.render())
            else:
                texts.append(child)
        return " ".join(texts)
1183431
def handle_startendtag(self, tag, attrs):
        """"""
        if tag.lower() in self.allowed_tag_whitelist:
            self.result += '<' + tag
            for (attr, value) in attrs:
                if attr.lower() in self.allowed_attribute_whitelist:
                    self.result += ' %s="%s"' % \
                        (attr, self.handle_attribute_value(value))
            self.result += ' />'
        else:
            if self.render_unallowed_tags:
                self.result += '&lt;' + cgi.escape(tag)
                for (attr, value) in attrs:
                    self.result += ' %s="%s"' % \
                        (attr, cgi.escape(value, True))
                self.result += ' /&gt;'
808451
def tag(self, tag):
        '''
        
        '''

        t = self.tag
        if t:
            if not tag:
                tag = t[-1]
            if tag in t:
                self._checkout(treeish=tag)
383596
def get_tags(self, only_autocomplete = False):
        """"""
        return self._to_dict(('id', 'name', 'autocomplete'), self.conn.GetTags(only_autocomplete))
1063517
def start_element(self, name, attrs):
        """"""
        self.in_tag = (name == self.tag)
        self.url = u""
1255067
function tag(name, attrs, close, content) {
  var end = close ? '/>' : '>';
  var pairs = [];
  var tag;

  for (var key in attrs) {
    if (Object.prototype.hasOwnProperty.call(attrs, key)) {
      pairs.push(key + '="' + escape(attrs[key]) + '"');
    }
  }

  tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
  if (content) {
    tag += content + '</' + name + end;
  }
  return tag;
}
351766
protected function handleTag_th()
    {
        if (!$this->keepHTML && !isset($this->table['rows'][1]) && !isset($this->table['aligns'][$this->col + 1])) {
            if (isset($this->parser->tagAttributes['align'])) {
                $this->table['aligns'][$this->col + 1] = $this->parser->tagAttributes['align'];
            } else {
                $this->table['aligns'][$this->col + 1] = '';
            }
        }
        $this->handleTag_td();
    }
636272
def handle_starttag(self, tag, attrs):
        """"""
        if (tag in self.newline_before_elements):
            self.text += '\n'
        if (tag in self.stroke_before_elements and not
                self.text.endswith(self.stroke_text)):
            # Put a stroke in front of every relevant element, if there is some
            # content between it and its predecessor
            self.text += self.stroke_text
        if tag == 'a':
            # If it's a link, append it to the link list
            for attr in attrs:
                if attr[0] == 'href':
                    self.links.append((len(self.links) + 1, attr[1]))
199181
def end_tag(self, alt=None):
        """"""
        if alt:
            name = alt
        else:
            name = self.name
        return "</" + name + ">"
1088848
def handle_tags(repo, **kwargs):
    """"""
    log.info('tags: %s %s' %(repo, kwargs))
    return [str(t) for t in repo.tags(**kwargs)]
69416
def _tag(element):
    """"""
    tag = element.tag
    if tag[0] == "{":
        uri, tag = tag[1:].split("}")
    return tag
1341593
protected function handleTag_ul()
    {
        if ($this->parser->isStartTag) {
            $this->stack();
            if (!$this->keepHTML && $this->lastClosedTag == $this->parser->tagName) {
                $this->out("\n" . $this->indent . '<!-- -->' . "\n" . $this->indent . "\n" . $this->indent);
            }
        } else {
            $this->unstack();
            if ($this->parent() != 'li' || preg_match('#^\s*(</li\s*>\s*<li\s*>\s*)?<(p|blockquote)\s*>#sU', $this->parser->html)) {
                // don't make Markdown add unneeded paragraphs
                $this->setLineBreaks(2);
            }
        }
    }
1307168
def pos_tag(args):
  """"""
  tagger = POSTagger(lang=args.lang)
  tag(tagger, args)