fixed weird line break issue by normalizing newlines before calculating diff