RE: [Zope] Quoting Text to valid HTML
Thanks all for all the responses. I kind of have what I was looking for, but it's not a perfect fit. Suggestions so far: 1. StripoGram - no good, this strips HTML tags, it doesn't fix invalid characters in text to be included in HTML 2. uTidy - great product, unfortunately it doesn't expose all its internals, so it's overkill, and doesn't work for snippets of HTML code 3. html_quote from Products.PythonScripts.standard- exactly what I want, but this is taking me back full circle. What I'm looking for is html_quote without having to install Zope. I could lift the code from the source for html_quote to allow my product to be self-contained (users will not have Zope) but this doesn't sit well with me. Also, as mentioned, it doesn't "replace åäöé etc." 4. Use zope - see above. Thanks for all the help. Samir. -----Original Message----- From: Samir Mishra [mailto:SamirMishra@cbuae.gov.ae] Sent: Monday, March 08, 2004 13:33 To: 'The Count' Cc: 'zope@zope.org' Subject: RE: [Zope] Quoting Text to valid HTML Thanks, I saw this earlier, but it's not what I need. What I need is - some_html_fn("this & that") -> "this & that" etc. but with more than just the "&" replacement. -----Original Message----- From: The Count [mailto:the.count@count0.dyndns.org] Sent: Monday, March 08, 2004 13:27 To: Samir Mishra Subject: Re: [Zope] Quoting Text to valid HTML On Mon, 8 Mar 2004 10:31:13 +0400, Samir Mishra <SamirMishra@cbuae.gov.ae> wrote:
This ought to be simple, but can't find module/function to do this.
Look in your favourite python-doc (http://www.python.org/doc/current/) /lib/module-urllib.html#l2h-3004 -- The Count Enjoy Your Web! http://count0.dyndns.org _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Samir Mishra wrote:
Suggestions so far:
1. StripoGram - no good, this strips HTML tags, it doesn't fix invalid characters in text to be included in HTML
read the docs, learn how to use html2safehtml properly ;-)
3. html_quote from Products.PythonScripts.standard- exactly what I want, but this is taking me back full circle. What I'm looking for is html_quote without having to install Zope.
Then why are you asking on a Zope list?! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Samir Mishra