Revert "Simplified formatBatchNewlines()"

This reverts commit 4f91d1c58fe208d09ba4a8a14f75b0f02752e0d1.