equal
deleted
inserted
replaced
208 content and attributes will be escaped |
208 content and attributes will be escaped |
209 """ |
209 """ |
210 value = u'<%s' % tag |
210 value = u'<%s' % tag |
211 if attrs: |
211 if attrs: |
212 value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value))) |
212 value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value))) |
213 for attr, value in attrs.items()) |
213 for attr, value in attrs.items() |
|
214 if value is not None) |
214 if content: |
215 if content: |
215 value += u'>%s</%s>' % (html_escape(unicode(content)), tag) |
216 value += u'>%s</%s>' % (html_escape(unicode(content)), tag) |
216 else: |
217 else: |
217 value += u'/>' |
218 value += u'/>' |
218 return value |
219 return value |