There is a Drupal 8 RenderElement called HtmlTag, which controls how HtmlTags are rendered. I would like to override this so that I can change its default behaviour.
I could write a class that extends HtmlTag and override what I need, but then how would Drupal core and the theme system know to use my new class?
Alternatively, maybe I should be using hook_theme_registry_alter()
to tell Drupal 8 to use my new class?
I'm not really sure of the best way of achieving this and there don't seem to be any examples of this being done.