Commit 2b577d20 authored by Guido van Rossum's avatar Guido van Rossum

When optimizing startEndTag, use " />" as the end separator when

generating HTML, and "/>" for XML, instead of always using "/>".

This is necessary for proper XHTML generation.
parent 116aebd2
......@@ -118,6 +118,10 @@ class TALGenerator:
output = []
collect = []
rawseen = cursor = 0
if self.xml:
endsep = "/>"
else:
endsep = " />"
for cursor in xrange(len(program)+1):
try:
item = program[cursor]
......@@ -133,7 +137,7 @@ class TALGenerator:
if self.optimizeStartTag(collect, item[1], item[2], ">"):
continue
if item[0] == "startEndTag":
if self.optimizeStartTag(collect, item[1], item[2], "/>"):
if self.optimizeStartTag(collect, item[1], item[2], endsep):
continue
text = string.join(collect, "")
if text:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment