lib/frozen-filters.rb
# Transforms an array into an enclose html tag list separated by newline.
# e.g. `{{ ["first","second" | array_to_taglist: "li" }}` =~
# ```html
# <li>first</li>
# <li>second</li>
# ```
# The the input isn't an array it returns the untouched input.
Transforms an array into an enclose html tag list separated by newline.
Transforms an array into an enclose html tag list separated by newline .
def array_to_taglist(input, p)
    if input.kind_of?(Array) && p.kind_of?(String)
      startTag = "<" + p + ">"
      endTag = "</" + p + ">"
      input.length != 0 ? startTag + input.join(endTag + "\n" + startTag) + endTag : ""
    else
      input
    end
  end
def array_to_taglist ( input , p ) if input . kind_of? ( Array ) && p . kind_of? ( String ) startTag = "<" + p + ">" endTag = "</" + p + ">" input . length != 0 ? startTag + input . join ( endTag + "\n" + startTag ) + endTag : "" else input end end
Transforms an array into an enclose html tag list separated by newline.
Transforms an array into an enclose html tag list separated by newline .
input
<not_specific>
p
<not_specific>