uilib.py
changeset 9543 39f981482e34
parent 9524 c4581bc582e1
child 9921 8227358aa983
equal deleted inserted replaced
9520:78702b55c089 9543:39f981482e34
   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,