def _text(self, text):
        if 'url' in text.properties:
            tag = Tag("a")
            tag.attrs['href'] = text.properties['url']
        else:
            tag = Tag(None)

        current = tag

        for prop in ('bold', 'italic', 'underline'):
            if prop in text.properties:
                newTag = Tag(_tagNames[prop])
                current.content.append(newTag)
                current = newTag

        for prop in ('sub', 'super'):
            if prop in text.properties:
                if current.tag is None:
                    newTag = Tag("span")
                    current.content.append(newTag)
                    current = newTag
                current.attrs['style'] = "vertical-align: %s; font-size: smaller" % prop

        current.content.append(u"".join(text.content))

        return tag
dataset/ETHPy150Open brendonh/pyth/pyth/plugins/xhtml/writer.py/XHTMLWriter._text/original