Commit 116aebd2 authored by Guido van Rossum's avatar Guido van Rossum

Now that self.html is set and cleared by do_mode(), also set

self.endsep to the proper value there.
parent adc93fda
...@@ -167,6 +167,7 @@ class TALInterpreter: ...@@ -167,6 +167,7 @@ class TALInterpreter:
self.showtal = showtal self.showtal = showtal
self.strictinsert = strictinsert self.strictinsert = strictinsert
self.html = 0 self.html = 0
self.endsep = "/>"
self.slots = {} self.slots = {}
self.currentMacro = None self.currentMacro = None
self.position = None, None # (lineno, offset) self.position = None, None # (lineno, offset)
...@@ -192,10 +193,6 @@ class TALInterpreter: ...@@ -192,10 +193,6 @@ class TALInterpreter:
def __call__(self): def __call__(self):
assert self.level == 0 assert self.level == 0
assert self.scopeLevel == 0 assert self.scopeLevel == 0
if self.html:
self.endsep = " />"
else:
self.endsep = "/>"
self.interpret(self.program) self.interpret(self.program)
assert self.level == 0 assert self.level == 0
assert self.scopeLevel == 0 assert self.scopeLevel == 0
...@@ -233,6 +230,10 @@ class TALInterpreter: ...@@ -233,6 +230,10 @@ class TALInterpreter:
def do_mode(self, mode): def do_mode(self, mode):
assert mode in ("html", "xml") assert mode in ("html", "xml")
self.html = (mode == "html") self.html = (mode == "html")
if self.html:
self.endsep = " />"
else:
self.endsep = "/>"
def do_setPosition(self, position): def do_setPosition(self, position):
self.position = position self.position = position
......
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