Fix textinput space stripping

Restores old behavior where by default lines are not stripped of leading/trailing spaces. It adds a strip option to control it which defaults to False.