parser: Remove trailing newline after prefixes have been cleared