add support for string already containing newlines
add spec and cover edge case