

def expand_tag(self, str):
    _str = str.group(0)
    s = re.findall('([\\w\\-]+(?:=(?:"[^"]*"|\\\'[^\\\']*\\\'))?)', _str)
    if (len(s) <= self.minimum_attribute_count):
        return _str
    tagEnd = re.search('/?>$', _str)
    if (not (tag == None)):
        s += [tagEnd.group(0)]
    tag = ('<' + s[0])
    indent = (len(tag) + 1)
    s = s[1:]
    if self.first_attribute_on_new_line:
        if self.indent_with_tabs:
            indent = 0
            extra_tabs = 1
        else:
            indent = self.indent_size
            extra_tabs = 0
    else:
        if self.indent_with_tabs:
            extra_tabs = int((indent / self.tab_size))
            indent = (indent % self.tab_size)
        else:
            extra_tabs = 0
        tag += (' ' + s[0])
        s = s[1:]
    for l in s:
        tag += ((('\n' + (((self.indent_level * self.indent_size) + extra_tabs) * self.indent_char)) + (indent * ' ')) + l)
    return tag

dataset/ETHPy150Open akalongman/sublimetext-codeformatter/codeformatter/lib/htmlbeautifier/__init__.py Beautifier.expand_tag/VarMisuse@65/98 `tagEnd`->`tag`