fix newline handling in tags