handle tags with no spaces after class or id attributes when cleaning up html

The cleanupHTML function wasn't correctly handling elements with no space after the class or id. For example,

```php
echo preg_replace('/(\s)+class="(.*)"(\s)+/U', ' ', '<img src="foo.jpg" class="something"><span class="bar" >bar</span>');
// prints '<img src="foo.jpg" >bar</span>'
```

This change makes whitespace after the last quote optional.