Edgewall Software

Ticket #518: htmlformfiller_html5_text_inputs.patch

File htmlformfiller_html5_text_inputs.patch, 1.2 KB (added by lm@…, 12 years ago)

apply with patch -p1

  • genshi/filters/html.py

    diff -ur Genshi-0.6/genshi/filters/html.py Genshi-0.6.mod/genshi/filters/html.py
    old new  
    2525__all__ = ['HTMLFormFiller', 'HTMLSanitizer']
    2626__docformat__ = 'restructuredtext en'
    2727
     28text_inputs = (
     29    '',
     30    'hidden',
     31    'text',
     32    # HTML 5
     33    'date',
     34    'datetime',
     35    'datetime-local',
     36    'email',
     37    'month',
     38    'number',
     39    'search',
     40    'tel',
     41    'time',
     42    'url',
     43    'week'
     44)
    2845
    2946class HTMLFormFiller(object):
    3047    """A stream filter that can populate HTML forms from a dictionary of values.
     
    114131                                    attrs |= [(QName('checked'), 'checked')]
    115132                                elif 'checked' in attrs:
    116133                                    attrs -= 'checked'
    117                         elif type in ('', 'hidden', 'text') \
     134                        elif type in text_inputs \
    118135                                or type == 'password' and self.passwords:
    119136                            name = attrs.get('name')
    120137                            if name and name in self.data: