core: Fix normalizeWhitespace handling of new lines.