I want to style a wtform field through a custom widget but the rendering keeps returning raw html code (with ampersands). Why?
this is my widget:
def my_widget(field, **kwargs):
field_id = kwargs.pop('id', field.id)
html = [u'<input class="my_class" %s value="" type="text">' % html_params(id=field_id, name=field_id)]
return u''.join(html)
You need to tell than string should be rendered as is without escaping HTML: