parameters: (self, tag, attrs)
docstring: Encountered the beginning of a tag
docstring_summary: Encountered the beginning of a tag
docstring_tokens: Encountered the beginning of a tag
function: def handle_starttag(self, tag, attrs):
          """Encountered the beginning of a tag"""
          if self.curr_state == 0:
              if tag == "body": self.curr_state = 1
          else: # self.curr_state == 1
              if tag == "span" and attrs[0][0] == cons.TAG_STYLE:
                  if "font-weight" in attrs[0][1]: self.curr_attributes[cons.TAG_WEIGHT] = cons.TAG_PROP_HEAVY
                  elif "font-style" in attrs[0][1] and cons.TAG_PROP_ITALIC in attrs[0][1]: self.curr_attributes[cons.TAG_STYLE] = cons.TAG_PROP_ITALIC
                  elif "text-decoration" in attrs[0][1] and cons.TAG_UNDERLINE in attrs[0][1]: self.curr_attributes[cons.TAG_UNDERLINE] = cons.TAG_PROP_SINGLE
                  elif "color" in attrs[0][1]:
                      match = re.match("(?<=^).+:(.+);(?=$)", attrs[0][1])
                      if match != None: self.curr_attributes[cons.TAG_FOREGROUND] = match.group(1).strip()
              elif tag == "a" and len(attrs) > 0:
                  link_url = attrs[0][1]
                  if len(link_url) > 7:
                      self.curr_attributes[cons.TAG_LINK] = get_internal_link_from_http_url(link_url)
              elif tag == "br":
                  # this is a data block composed only by an endline
                  self.rich_text_serialize(cons.CHAR_NEWLINE)
                  self.chars_counter += 1
              elif tag == "hr":
                  # this is a data block composed only by an horizontal rule
                  self.rich_text_serialize(cons.CHAR_NEWLINE+self.dad.h_rule+cons.CHAR_NEWLINE)
                  self.chars_counter += len(self.dad.h_rule)+2
              elif tag == "li":
                  self.rich_text_serialize(cons.CHAR_NEWLINE+self.dad.chars_listbul[0]+cons.CHAR_SPACE)
                  self.chars_counter += 3
function_tokens: def handle_starttag ( self , tag , attrs ) : if self . curr_state == 0 : if tag == "body" : self . curr_state = 1 else : # self.curr_state == 1 if tag == "span" and attrs [ 0 ] [ 0 ] == cons . TAG_STYLE : if "font-weight" in attrs [ 0 ] [ 1 ] : self . curr_attributes [ cons . TAG_WEIGHT ] = cons . TAG_PROP_HEAVY elif "font-style" in attrs [ 0 ] [ 1 ] and cons . TAG_PROP_ITALIC in attrs [ 0 ] [ 1 ] : self . curr_attributes [ cons . TAG_STYLE ] = cons . TAG_PROP_ITALIC elif "text-decoration" in attrs [ 0 ] [ 1 ] and cons . TAG_UNDERLINE in attrs [ 0 ] [ 1 ] : self . curr_attributes [ cons . TAG_UNDERLINE ] = cons . TAG_PROP_SINGLE elif "color" in attrs [ 0 ] [ 1 ] : match = re . match ( "(?<=^).+:(.+);(?=$)" , attrs [ 0 ] [ 1 ] ) if match != None : self . curr_attributes [ cons . TAG_FOREGROUND ] = match . group ( 1 ) . strip ( ) elif tag == "a" and len ( attrs ) > 0 : link_url = attrs [ 0 ] [ 1 ] if len ( link_url ) > 7 : self . curr_attributes [ cons . TAG_LINK ] = get_internal_link_from_http_url ( link_url ) elif tag == "br" : # this is a data block composed only by an endline self . rich_text_serialize ( cons . CHAR_NEWLINE ) self . chars_counter += 1 elif tag == "hr" : # this is a data block composed only by an horizontal rule self . rich_text_serialize ( cons . CHAR_NEWLINE + self . dad . h_rule + cons . CHAR_NEWLINE ) self . chars_counter += len ( self . dad . h_rule ) + 2 elif tag == "li" : self . rich_text_serialize ( cons . CHAR_NEWLINE + self . dad . chars_listbul [ 0 ] + cons . CHAR_SPACE ) self . chars_counter += 3