[Zope] strip HTML-Tags

Harry Wilkinson harryw@nipltd.com
Thu, 31 Jan 2002 16:44:23 +0000


On Thursday 31 January 2002 4:29 pm, Florian Fahrbach wrote:
> Hi,
> I hope that somebody has a solution for my problem: I need to strip
> Html-Tags from a text in ZOPE which I want so send via E-Mail. I pass the
> text as a variable to a python script which looks like this:
>
> import re
> strip_html_pattern = re.compile(r'<[^>]*>')
> plaintext = strip_html_pattern.sub('',text)
> return plaintext
>
> But it doesn't work. The script asks for password and username, although it
> has the "manager"-role. Does anybody know a way that works? Perhaps there
> is a less difficult way of doing this (I tried to strip the tags in the
> dtml-document directly, but it didn't work also).
> Greetings
> F. Fahrbach

Check out stripogram - http://www.zope.org/Members/chrisw/StripOGram