The following code snippet helps preprocessing
& filtering out handles from a textarea setting.
snippets/Handleize.liquid
{%- liquid
#
# Snippet : ๐๐ฎ๐ป๐ฑ๐น๐ฒ๐ถ๐๐ฒ
#
#
# ๐ฃ๐ฎ๐ฟ๐ฎ๐บ๐ฒ๐๐ฒ๐ฟ๐
# $ Handleize : String
#
############################################################################
assign BreakTag = '<br />'
############################################################################
assign input = Handleize
############################################################################
if input == blank
break
endif
############################################################################
assign input = input | strip
assign lines = input | newline_to_br | split : BreakTag
############################################################################
for line in lines
if line == blank
continue
endif
echo line | handleize
unless forloop .last
echo ','
endunless
endfor
-%}
Donโt forget to remove any whitespace before & after the liquid block as
- at the point of writing - there is still a bug that inserts a newline at the
start of the output of every snippet when whitespace is present.
Test.liquid
{%- capture text -%}
handle-1
Readable-But-Wrong-Case-Handle
{%- endcapture -%}
{%- liquid
capture handles
render 'Handleize' with text
endcapture
-%}
[{{ handles }}]
Output
[handle-1,readable-but-wrong-case-handle]