Refactors parse_item_list
Extracts common function to flatten text descendants
Refactors truncate spaces function
Adds breakline before elements