remapping for removing extra line-end chars