Exemplo n.º 1
0
    def flattened ( o ):
        if o.render:
            o = o.render ( o, o.data )
            if not isinstance ( o, Tag ):
                yield flatten ( o )
                raise StopIteration

        yield u'<%s%s>' % ( o.name, u''.join ( quoteattrs ( o.attrs ) ) )
        for c in o.children:
            yield flatten ( c )
        yield u'</%s>' % o.name
        raise StopIteration 
Exemplo n.º 2
0
def flatten_empty_html4_tag ( o ):
    if o.render:
        o = o.render ( o, o.data )

    attrs = u''.join ( quoteattrs ( o.attrs ) )
    return u'<%s%s>' % ( o.name, attrs )