It’s not obvious to me how we should be extending the colourization to make this happen. I’m under the impression I extend what is valid with html_write:expand//1
but remain baffled how to do so. Making an expansion, it never gets called.
The colouring code is in html_write.pl. Using the expand//1 hook is in my current perspective a mistake, at least to support user extensions. It is also used to process the output of the HTML parser. That is fine. Users should use \callable to create modular pages. All the coloring for that should work just fine.