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]