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
Samir Mishra wrote:
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.
Try Strip-O-Gram: http://zope.org/Members/chrisw/StripOGram/ cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Mon, Mar 08, 2004 at 01:33:05PM +0400, Samir Mishra wrote:
What I need is - some_html_fn("this & that") -> "this & that" etc. but with more than just the "&" replacement.
Try http://utidylib.sourceforge.net (a Python wrapper for tidy). Pieter -- http://zwiki.org/PieterB
PieterB wrote:
On Mon, Mar 08, 2004 at 01:33:05PM +0400, Samir Mishra wrote:
What I need is - some_html_fn("this & that") -> "this & that" etc. but with more than just the "&" replacement.
What's wrong with the html_quote function? <dtml-var "'this & that'" html_quote> or from Products.PythonScripts.standard import html_quote print html_quote("this & that") But it doesn't replace åäöé etc.
Try http://utidylib.sourceforge.net (a Python wrapper for tidy).
Pieter
-- Peter Bengtsson, http://www.peterbe.com
If I have a site in, say, Turkish, and have set it up to be utf-8, but the site also contains iso8859-1 characters. The later do not show up if they are not quoted. In fact, any word containing such a iso8859-1 character is gone from the generated html source. In this case it is a Plone site. My users enter text in either the ZMI (less often) or via Plone's built-in editor. Being non-computer savy, the people entering the text just want to use the characters on their keyboard. It is not going to happen that they learn how to quote when they add articles. So, how, specifically, would I use these tools to quote the text site-wide? It seems that the current state of Zope/CMF/Plone allows many languages, including utf-8 - as long as there is one at a time. If the text is not utf-8 (or whatever the site is set to be), it must be simple ASCII. Content within a site, in some user-added text, cannot be something else. Right? Or did I miss something obvious here. BTW, I would really like to be able to add 'localecontent' instead of simple 'documents', but that code has never worked for me. Should it be working with the current Zope(2.6.2)/CMF(1.4)/Plone(2) products? Would that sort out this problem? Anyone got that to work? On Tue, 2004-03-09 at 01:13, Peter Bengtsson wrote:
PieterB wrote:
On Mon, Mar 08, 2004 at 01:33:05PM +0400, Samir Mishra wrote:
What I need is - some_html_fn("this & that") -> "this & that" etc. but with more than just the "&" replacement.
What's wrong with the html_quote function? <dtml-var "'this & that'" html_quote>
or from Products.PythonScripts.standard import html_quote
print html_quote("this & that") But it doesn't replace åäöé etc.
Try http://utidylib.sourceforge.net (a Python wrapper for tidy).
Pieter
Roger Oberholtzer wrote:
If I have a site in, say, Turkish, and have set it up to be utf-8, but the site also contains iso8859-1 characters.
I'm not sure having a mixed-encoding lump of text makes sense in any context... What, exactly, would you like hte browser and/or server to do here? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (5)
-
Chris Withers -
Peter Bengtsson -
PieterB -
Roger Oberholtzer -
Samir Mishra