to strip whitespace:

    {%- for pref in details.prefs -%}