Improved handling of newlines in list items