Move multiline replacement logic to client side.