[py-svn] r31237 - py/dist/py/xmlobj

guido at codespeak.net guido at codespeak.net
Thu Aug 10 18:17:07 CEST 2006


Author: guido
Date: Thu Aug 10 18:17:05 2006
New Revision: 31237

Modified:
   py/dist/py/xmlobj/html.py
Log:
(jan, guido) Completed lists of HTML tags.


Modified: py/dist/py/xmlobj/html.py
==============================================================================
--- py/dist/py/xmlobj/html.py	(original)
+++ py/dist/py/xmlobj/html.py	Thu Aug 10 18:17:05 2006
@@ -7,7 +7,24 @@
 
 class HtmlVisitor(SimpleUnicodeVisitor): 
     
-    singletons = ['area', 'link']
+    not_single = ['a', 'abbr', 'acronym', 'address', 'applet',
+                    'b', 'bdo', 'big', 'blink', 'blockquote',
+                    'body', 'button', 'caption', 'center', 'cite',
+                    'comment', 'del', 'dfn', 'dir', 'div',
+                    'dl', 'dt', 'em', 'embed', 'fieldset',
+                    'font', 'form', 'frameset', 'h1', 'h2',
+                    'h3', 'h4', 'h5', 'h6', 'head', 'html',
+                    'i', 'iframe', 'ins', 'kbd', 'label', 'legend', 
+                    'li', 'listing', 'map', 'marquee', 'menu',
+                    'multicol', 'nobr', 'noembed', 'noframes',
+                    'noscript', 'object', 'ol', 'optgroup',
+                    'option', 'p', 'pre', 'q', 's', 'script',
+                    'select', 'small', 'span', 'strike',
+                    'strong', 'style', 'sub', 'sup', 'table',
+                    'tbody', 'td', 'textarea', 'tfoot',
+                    'th', 'thead', 'title', 'tr', 'tt', 'u',
+                    'ul', 'xmp']
+
 
     def repr_attribute(self, attrs, name): 
         if name == 'class_':
@@ -17,7 +34,7 @@
         return super(HtmlVisitor, self).repr_attribute(attrs, name) 
 
     def _issingleton(self, tagname):
-        return tagname in self.singletons
+        return tagname not in self.not_single
 
 class HtmlTag(Tag): 
     def unicode(self, indent=2):
@@ -30,12 +47,16 @@
     __tagclass__ = HtmlTag
     __stickyname__ = True 
     __tagspec__ = dict([(x,1) for x in ( 
-        "h1,h2,h3,h5,h6,p,b,i,a,div,span,code,"
-        "html,head,title,style,table,thead,tr,tt,"
-        "td,th,link,img,meta,body,pre,br,ul,"
-        "ol,li,em,form,input,select,option,"
-        "button,script,colgroup,col,map,area,"
-        "blockquote,dl,dt,dd,strong"
+        'a,abbr,acronym,address,applet,area,b,bdo,big,blink,'
+        'blockquote,body,br,button,caption,center,cite,code,col,'
+        'colgroup,comment,dd,del,dfn,dir,div,dl,dt,em,embed,'
+        'fieldset,font,form,frameset,h1,h2,h3,h4,h5,h6,head,html,'
+        'i,iframe,img,input,ins,kbd,label,legend,li,link,listing,'
+        'map,marquee,menu,meta,multicol,nobr,noembed,noframes,'
+        'noscript,object,ol,optgroup,option,p,pre,q,s,script,'
+        'select,small,span,strike,strong,style,sub,sup,table,'
+        'tbody,td,textarea,tfoot,th,thead,title,tr,tt,u,ul,xmp,'
+        'base,basefont,frame,hr,isindex,param,samp,var'
     ).split(',') if x])
 
     class Style(object): 



More information about the pytest-commit mailing list