modify line split logic and add tests case