Ejemplo n.º 1
0
    def parse_starttag(self, htmltag, attrs):
        par_type = "bullet"

        for key, value in attrs:
            if key == "style":
                for statement in value.split(";"):
                    key2, value2 = statement.split(":")
                    value2 = value2.strip()

                    if key2.strip() == "list-style-type":
                        if value2 == "disc":
                            par_type = "bullet"
                        elif value2 == "none":
                            par_type = "none"

        tag = TagNameDom("li %s" % par_type)
        self._io.append_child(tag, True)
Ejemplo n.º 2
0
 def parse_starttag(self, htmltag, attrs):
     # self._io is a RedNotebookHtmlBuffer instance
     self._io.append_text("\n")
     self._io.append_child(TagNameDom('h3'), True)
Ejemplo n.º 3
0
 def parse_starttag(self, htmltag, attrs):
     self._io.append_child(TagNameDom("ol"), True)
Ejemplo n.º 4
0
 def parse_starttag(self, htmltag, attrs):
     for key, value in attrs:
         if key == "style":
             for tagstr in parse_css_style(value):
                 self._io.append_child(TagNameDom(tagstr), True)
Ejemplo n.º 5
0
 def parse_starttag(self, htmltag, attrs):
     for key, value in attrs:
         if key == "href":
             tag = TagNameDom("link " + value)
             self._io.append_child(tag, True)
             break
Ejemplo n.º 6
0
 def parse_starttag(self, htmltag, attrs):
     tagstr = self.html2buffer_tag[htmltag]
     self._io.append_child(TagNameDom(tagstr), True)