Filter to product HTML output from XHTML
This commit is contained in:
parent
2169f34b7c
commit
0f65d3e123
5
filters/xhtml2html.py
Normal file
5
filters/xhtml2html.py
Normal file
@ -0,0 +1,5 @@
|
||||
import sys
|
||||
from genshi.input import XMLParser
|
||||
from genshi.output import HTMLSerializer
|
||||
|
||||
print ''.join(HTMLSerializer()(XMLParser(sys.stdin))).encode('utf-8')
|
@ -14,6 +14,13 @@ class GenshiFilterTests(unittest.TestCase):
|
||||
self.assertTrue(output.find(' href="http://planet.intertwingly.net/opensearchdescription.xml"')>=0)
|
||||
self.assertTrue(output.find('</script>')>=0)
|
||||
|
||||
def test_xhtml2html_filter(self):
|
||||
testfile = 'tests/data/filter/index.html'
|
||||
filter = 'xhtml2html.py'
|
||||
output = shell.run(filter, open(testfile).read(), mode="filter")
|
||||
self.assertTrue(output.find('/>')<0)
|
||||
self.assertTrue(output.find('</script>')>=0)
|
||||
|
||||
try:
|
||||
import genshi
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user