Sometimes it is useful to be able to format text using a one of the filter module's text formats defined at /admin/config/content/formats. Such as the Drupal "Basic HTML" or "Full HTML" filters, or a custom filter.
A common use case for this would be when using Rules to send email, if we want to ensure there is no unsafe markup in user-provided HTML.
This patch adds the 'format_text' typed data filter which may be used like this:
{{ node.body | format_text('full_html') }}
See https://www.drupal.org/docs/8/modules/d8-rules-essentials/token-replacem... more more information on using data filters.
| Comment | File | Size | Author |
|---|---|---|---|
| format-text-filter.patch | 1.99 KB | tr |
Comments
Comment #2
tr commentedComment #4
tr commentedCommitted.
Comment #5
jonathan1055 commentedNice.