Help regarding lists

How convert this kind of list

To this kind of list

The easiest way I know would be to use javascript and .flat()

Use the webviewer and the runJavascript block

Instead of trying to convert that into a flat list, go upstream and find out how it is being wrapped like an onion, and fix it upstream.

It can be solved using Recursion,