Html: improve handling of data attributes