Extract the current attribute value up to a space or > so that we don't ...

...get the content of next tag in the current attribute value.n This fixes issue #3229.