Update newline formatting logic