Replace with an array?

Galen King's Avatar

Galen King

29 Nov, 2010 08:34 PM via web

Is it possible to pass an array (or is it a hash—I can never remember) for the search and replace parameters in replace? I.e., {{ item.body | replace: {'&','&nbsp'},{'&',' '} }}

  1. Support Staff 2 Posted by Steve Smith on 29 Nov, 2010 08:38 PM

    Steve Smith's Avatar

    No, you'll just have to do the filter twice.

    {{ item.body | replace: '&', '&' | replace ' ', ' ' }}

    #close

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

17 May, 2012 10:45 PM
20 Mar, 2012 05:05 PM
26 Apr, 2012 01:40 AM
07 Mar, 2012 04:42 PM