uilib.py
branchstable
changeset 9524 c4581bc582e1
parent 9326 9d145b4c4e53
child 9921 8227358aa983
equal deleted inserted replaced
9523:cd5738fc440f 9524:c4581bc582e1
   213 from lxml import etree, html
   213 from lxml import etree, html
   214 from lxml.html import clean, defs
   214 from lxml.html import clean, defs
   215 
   215 
   216 ALLOWED_TAGS = (defs.general_block_tags | defs.list_tags | defs.table_tags |
   216 ALLOWED_TAGS = (defs.general_block_tags | defs.list_tags | defs.table_tags |
   217                 defs.phrase_tags | defs.font_style_tags |
   217                 defs.phrase_tags | defs.font_style_tags |
   218                 set(('span', 'a', 'br', 'img', 'map', 'area', 'sub', 'sup'))
   218                 set(('span', 'a', 'br', 'img', 'map', 'area', 'sub', 'sup', 'canvas'))
   219                 )
   219                 )
   220 
   220 
   221 CLEANER = clean.Cleaner(allow_tags=ALLOWED_TAGS, remove_unknown_tags=False,
   221 CLEANER = clean.Cleaner(allow_tags=ALLOWED_TAGS, remove_unknown_tags=False,
   222                         style=True, safe_attrs_only=True,
   222                         style=True, safe_attrs_only=True,
   223                         add_nofollow=False,
   223                         add_nofollow=False,