Skip to content

Commit eecf844

Browse files
author
Gordon B. McMillan
committed
Fix so it can do <display...> inside an attribute of another tag.
1 parent a6e603a commit eecf844

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

roundup/template_parser.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,17 @@ def append_data(self, data):
7070
self.current.append(data)
7171

7272
def unknown_starttag(self, tag, attributes):
73-
s = ''
74-
s = s + '<%s' % tag
73+
self.append_data('<%s' % tag)
74+
closeit = 1
7575
for name, value in attributes:
76-
s = s + ' %s="%s"' % (name, value)
77-
s = s + '>'
78-
self.append_data(s)
76+
pos = value.find('<')
77+
if pos > -1:
78+
self.append_data(' %s="%s' % (name, value[:pos]))
79+
closeit = 0
80+
else:
81+
self.append_data(' %s="%s"' % (name, value))
82+
if closeit:
83+
self.append_data('>')
7984

8085
def handle_starttag(self, tag, method, attributes):
8186
if tag in ('require', 'else', 'display', 'property'):

0 commit comments

Comments
 (0)