Do not remove HTML attributes if components are not present

Closes #1096