Updated FoldText() function to better support folded brackets