root/Zope2/PortalTransforms/trunk/transforms/html_to_text.py

Revision 19076, 475 bytes (checked in by sfermigier, 6 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 from Products.PortalTransforms.libtransforms.retransform import retransform
2
3 class html_to_text(retransform):
4     inputs  = ('text/html',)
5     output = 'text/plain'
6
7 def register():
8     return html_to_text("html_to_text",
9                        ('<script [^>]>.*</script>(?im)', ''),
10                        ('<style [^>]>.*</style>(?im)', ''),
11                        ('<head [^>]>.*</head>(?im)', ''),
12                        ('<[^>]*>(?i)(?m)', ''),
13                        )
Note: See TracBrowser for help on using the browser.