Skip to content

Improve wordwrap filter for blocks

Based on Jinja documentation, it looks like it should be possible to use a block filter in a package description like this:

 {% filter wordwrap(74) -%}
 Some description where I use {{variable_1}} and {{variable_2}} and the line breaks need to be placed based on the length of those variables.
 {%- endfilter %}

But then auto-escaping is done before the filter is applied, and doesn't indent the result as needed. Instead I need to start with:

 {% filter wordwrap(74) | indent(1) -%}

which is exactly the sort of thing I wanted to avoid making everyone write.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information