html: amend default tip
authorTero Marttila <terom@fixme.fi>
Fri, 21 Jan 2011 04:44:30 +0200
changeset 61 ce1d012d02fe
parent 60 b364279347d9
html: amend
svv/html.py
--- a/svv/html.py	Fri Jan 21 04:40:36 2011 +0200
+++ b/svv/html.py	Fri Jan 21 04:44:30 2011 +0200
@@ -59,8 +59,13 @@
 class Text (Renderable) :
     """
         Plain un-structured/un-processed HTML text for output
-
-
+        
+        >>> Text('foo')
+        Text(u'foo')
+        >>> list(Text('<foo>'))
+        [u'<foo>']
+        >>> list(tag('a', Text('<foo>')))
+        [u'<a>', u'\\t<foo>', u'</a>']
     """
 
     def __init__ (self, text) :
@@ -388,39 +393,6 @@
             ) for name, value in self.attrs.iteritems()
         )
 
-
-    def render_raw_lines (self, indent=u'\t') :
-        """
-            Render the tag and indented content
-
-        """
-        
-        # opts
-        selfclosing = self.attrs.get('_selfclosing')
-        whitespace_sensitive = self.attrs.get('_whitespace_sensitive')
-
-        # render attr string, including preceding space
-        attrs_stuff = (" " + self.render_attrs()) if self.attrs else ""
-
-        if self.contents or selfclosing is False:
-
-            if not whitespace_sensitive :
-                # wrapping tags
-                yield u"<%s%s>" % (self.name, attrs_stuff)
-                
-                # subcontents
-                for line in super(Tag, self).render_raw_lines(indent=indent) :
-                    yield indent + line
-
-                yield u"</%s>" % (self.name, )
-            
-            else :
-                # whole tag
-                yield u"<%s%s>%s</%s>" % (self.name, attrs_stuff, ''.join(super(Tag, self).render_raw_lines(indent=indent)), self.name)
-        else :
-            # singleton tag
-            yield u"<%s%s />" % (self.name, attrs_stuff)
- 
     def flatten_items (self, indent=1) :
         """
             Flatten our content into a series of indented lines.