Generate id attributes for HTML block elements