comparison MoinMoin/filter/text_xml.py @ 470:957d482215ac

lupy: some filters, update mode imported from: moin--main--1.5--patch-474
author Thomas Waldmann <tw@waldmann-edv.de>
date Mon, 13 Mar 2006 19:31:36 +0000
parents
children bb2e053067fb
comparison
equal deleted inserted replaced
469:ff99c7d6ffcb 470:957d482215ac
1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - text/xml file Filter
4
5 @copyright: 2006 by ThomasWaldmann MoinMoin:ThomasWaldmann
6 @license: GNU GPL, see COPYING for details.
7 """
8
9 import re
10 from MoinMoin.filter.text import execute as textfilter
11
12 rx_stripxml = re.compile("<[^>]*?>", re.DOTALL|re.MULTILINE)
13
14 def execute(indexobj, filename):
15 data = textfilter(indexobj, filename)
16 try:
17 data = " ".join(rx_stripxml.sub(" ", data).split())
18 except RuntimeError, err:
19 indexobj.request.log(str(err))
20 data = ""
21 return data
22