Example #1
0
    def object_fix(self, attrs):
        tagtext = SGMLParser.get_starttag_text(self)
        stagtext = tagtext.split("+")

        if len(stagtext) == 1:
            return attrs

        fixed_attrs = []
        value = ""
        for p in stagtext:
            value += p.strip().strip("\"").strip("\'")

        t = value.lstrip("<object").split(">")[0].strip().split()
        for s in t:
            tagname = s.split("=")[0]
            tagvalue = s.split("=")[1].strip("\"").strip("\'")
            fixed_attrs.append((tagname, tagvalue))

        return fixed_attrs
Example #2
0
    def object_fix(self, attrs):
        tagtext  = SGMLParser.get_starttag_text(self)
        stagtext = tagtext.split("+")

        if len(stagtext) == 1:
            return attrs

        fixed_attrs = []
        value = ""
        for p in stagtext:
            value += p.strip().strip("\"").strip("\'")

        t = value.lstrip("<object").split(">")[0].strip().split()
        for s in t:
            tagname  = s.split("=")[0]
            tagvalue = s.split("=")[1].strip("\"").strip("\'")
            fixed_attrs.append((tagname, tagvalue))

        return fixed_attrs