comparison roundup/template_parser.py @ 962:540fc5fb20d4

Fix so it can do <display...> inside an attribute of another tag.
author Gordon B. McMillan <gmcm@users.sourceforge.net>
date Tue, 20 Aug 2002 14:24:19 +0000
parents fdcf16b444a9
children
comparison
equal deleted inserted replaced
961:7d68f88f0642 962:540fc5fb20d4
68 self.current[-1] = self.current[-1] + data 68 self.current[-1] = self.current[-1] + data
69 else: 69 else:
70 self.current.append(data) 70 self.current.append(data)
71 71
72 def unknown_starttag(self, tag, attributes): 72 def unknown_starttag(self, tag, attributes):
73 s = '' 73 self.append_data('<%s' % tag)
74 s = s + '<%s' % tag 74 closeit = 1
75 for name, value in attributes: 75 for name, value in attributes:
76 s = s + ' %s="%s"' % (name, value) 76 pos = value.find('<')
77 s = s + '>' 77 if pos > -1:
78 self.append_data(s) 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('>')
79 84
80 def handle_starttag(self, tag, method, attributes): 85 def handle_starttag(self, tag, method, attributes):
81 if tag in ('require', 'else', 'display', 'property'): 86 if tag in ('require', 'else', 'display', 'property'):
82 method(attributes) 87 method(attributes)
83 else: 88 else:

Roundup Issue Tracker: http://roundup-tracker.org/