How to use <CR> as a list delimiter

I’m not understanding why my code is failing here. It’s been working fine for a long time in Adobe ColdFusion and I can’t find the change I need to make to make it work in Lucee 5.3
It’s a set of parameters that users can put in a form. They put them in a separate line for each parameter with 2 or 3 elements for each parameter. The text area in the form looks like this when filled in:

AddNewContentAt| string |bottom
AddNewPageAT| string| top
min access level Edit |numeric| 20
min access level Approve| numeric| 90

There can be any number of these lines (sets of parameters). Any parameter can have spaces or dashes. I need to parse these to use them to process, so they’ll parse into:

<min access level Edit><numeric><20>
<min access level Approve><numeric><90>

I know there are probably better ways to do this in Lucee, but I need to maintain backward compatibility for now. How can i get from the simple text-based list to the tag based ones?
Here’s what used to work in ACF but doesnt in Lucee:
<cfset first = trim(listfirst(line,"|")) /><cfset last = trim(listlast(line,"|")) /><cfset second = trim(line.ListGetAt( 2 ,"|")) />
<cfargument name="#first#" type="#second#" required=“false” default="#last#">

THe error is with the “Second” element - the last one calculated. It doesnt think ‘2’ is a valid number. I’ve tried all combinations of ’ and " and changed the “|” delimeter but I’m obviously missing something. Can anyone see what I’m missing please?

Mike Kear
Windsor, NSW, Australia

@mikek can you please provide the error you got in the second element? and the stacktrace?