equal
deleted
inserted
replaced
207 |
207 |
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 try: |
|
213 attrs['class'] = attrs.pop('klass') |
|
214 except KeyError: |
|
215 pass |
212 value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value))) |
216 value += u' ' + u' '.join(u'%s="%s"' % (attr, html_escape(unicode(value))) |
213 for attr, value in attrs.items() |
217 for attr, value in attrs.items() |
214 if value is not None) |
218 if value is not None) |
215 if content: |
219 if content: |
216 value += u'>%s</%s>' % (html_escape(unicode(content)), tag) |
220 value += u'>%s</%s>' % (html_escape(unicode(content)), tag) |