def closing_tag(state, text, i, formats, user_data):
 ch = text[i]
 if (ch in space_chars):
  return [(1, None)]
 pos = text.find(u'>', i)
 if (pos == (-1)):
  return [((len(text) - i), formats[u'bad-closing'])]
 state.parse = NORMAL
 num = ((pos - i) + 1)
 ans = [(1, formats[u'end_tag'])]
 if (num > 1):
  ans.insert(0, ((num - 1), formats[u'bad-closing']))
 add_tag_data(user_data, TagEnd(pos, False, False))
 return ans

def closing_tag ( state , text , i , formats , user_data ) : ch = text [ i ] if ( ch in space_chars ) : return [ ( 1 , None ) ] pos = text . find ( u'>' , i ) if ( pos == ( - 1 ) ) : return [ ( ( len ( text ) - i ) , formats [ u'bad-closing' ] ) ] state . parse = NORMAL num = ( ( pos - i ) + 1 ) ans = [ ( 1 , formats [ u'end_tag' ] ) ] if ( num > 1 ) : ans . insert ( 0 , ( ( num - 1 ) , formats [ u'bad-closing' ] ) ) add_tag_data ( user_data , TagEnd ( pos , False , False ) ) return ans
a closing tag like </a> .