{% from "macros/form/input_block.html" import input_block %} {% from "macros/form/attributes.html" import attributes %} {# Creates all the markup required for a Markdown textarea element. Handles matching labels to inputs, selected item and error messages. name - The name of the form parameter. id - The id to use on the input and label. Convention is to prefix with 'field-'. label - The human readable label. value - The value of the input. placeholder - Some placeholder text. error - A list of error strings for the field or just true to highlight the field. classes - An array of classes to apply to the form-group. is_required - Boolean of whether this input is requred for the form to validate Examples: {% import 'macros/form.html' as form %} {{ form.markdown('desc', id='field-description', label=_('Description'), value=data.desc, error=errors.desc) }} #} {% macro markdown(name, id='', label='', value='', placeholder='', error="", classes=[], attrs={'class': 'form-control'}, is_required=false) %} {% set classes = (classes|list) %} {% do classes.append('control-full') %} {% set markdown_tooltip = "
__Bold text__ or _italic text_
# title
## secondary title
### etc* list
* of
* itemshttp://auto.link.ed/
Please note: HTML tags are stripped out for security reasons
" %} {%- set extra_html = caller() if caller -%} {% call input_block(id or name, label or name, error, classes, control_classes=["editor"], extra_html=extra_html, is_required=is_required) %} {% trans %}You can use Markdown formatting here{% endtrans %} {% endcall %} {% endmacro %}