[Zope] More tolerant Stripogram (solution)

Jaroslav Lukesh lukesh at seznam.cz
Mon May 2 03:04:25 EDT 2005


Hi all,

I was extend SquishDot with wysiwyg editor (origin: vsbabu ieeditor). But it was not 
accept many tags due too small number of allowed html attributes in stripogram.

I was patch stripogram to be more tolerant for eg., tables and other tags (missings: 'html' and 'body'). 
Make changes to following variables in html2safehtml.py, __init__.py  and select your acceptable 
tags and make changes your code from where you are calling html stripping 
(for example in SquishDot 1.5 it is SquishSite.py, line 408).

    can_close   = ['ul','li','p','dd','dl','dt','ol','option','bdo','listing','map','optgroup','option','param',
		    'marquee','menu','multicol','nobr','noembed','noframes','nolayer','noscript','plaintext','pre','q','rt','ruby','s','samp',
		    'b','i','u','big','small','em','strong','blink','blockquote','center','cite','code','tt','ins','kbd','keygen',
		    'table','del','strike-thru','dfn','fieldset','font','form','frame','frameset','label''caption','legend',
		    'h1','h2','h3','h4','h5','h6','head','iframe','ilayer','layer','object','select','strike','sub','sup',
		    'trow','thead','tbody','textarea','tr','tt','var','xml','xmp','title',
		    'div','span','a','abbr','acronym','area','th','td']
    never_close = ['br','wbr','hr', 'input', 'isindex','base','meta','basefont','bgsound','button','spacer',
		    'col','colgroup','embed','isindex','link',
		    'img']

If you want to save space ant you put 'td', 'th','tr', 'p' etc to never_close (which is acceptable for browsers), 
stripping will destroy html code :-(

I dont know if some tag is missing (so sorry), it was done with "visibone web designer's html card" on the desk, not w3c.

Best Regards,

-- 

                        Jaroslav Lukesh
  -----------------------------------------------------------
  This e-mail can not contain any viruses because I use Linux



More information about the Zope mailing list