Commit c32bb816 authored by Guido van Rossum's avatar Guido van Rossum

Optimize output of rawtext by joining adjacent rawtext items.

parent f23230fb
......@@ -143,7 +143,12 @@ class TALGenerator:
self.program.append(("endTag", name))
def emitText(self, text):
self.program.append(("rawtext", cgi.escape(text)))
text = cgi.escape(text)
if self.program and self.program[-1][0] == "rawtext":
# Concatenate text
self.program[-1] = ("rawtext", self.program[-1][1] + text)
return
self.program.append(("rawtext", text))
def emitDefines(self, defines):
for part in splitParts(defines):
......
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