    WYSIHTML5 widget
    ================

    Features
    --------

        - renders textarea with wysihtml5 css class and provides a wysihtml5
          resources.

    Load requirements::

        >>> import yafowil.loader
        >>> import yafowil.widget.wysihtml5

    Test widget::

        >>> from yafowil.base import factory

    Render widget::

        >>> widget = factory('wysihtml5', 'rt', props={'required': True})
        >>> widget()
        u'
    '

    Widget extraction::

        >>> request = {'rt': ''}
        >>> data = widget.extract(request)

    No input was given::

        >>> data.errors
        [ExtractionError('Mandatory field was empty',)]

    Empty string in extracted::

        >>> data.extracted
        ''

    Widget extraction. Returns markup from tinymce::

        >>> request = {'rt': '

1

    '}
        >>> data = widget.extract(request)
        >>> data.errors
        []

        >>> data.extracted
        '

1

' >>> widget(data) u'
    <p>1</p>
    '

    Display renderer::

        >>> widget = factory('wysihtml5', 'rt', value='

foo

    ', mode='display')
        >>> widget()
        u'

foo

    '

        >>> widget = factory('wysihtml5', 'rt', mode='display')
        >>> widget()
        u'
    '

    More options::

        >>> widget = factory('wysihtml5', 'rt', props={'required': True,
        ... 'focus': True, 'resize': True, 'size': 'xs', 'color': True,
        ... 'emphasis': True, 'font-styles': True, 'html': True, 'image': True,
        ... 'justify': True, 'link': True, 'lists': True,
        ... 'stylesheets': ['style1', 'style2']})
        >>> widget()
        u'
'