I replied to this a long time ago and in the original case - I did not see huge value in the suggestion. But recently I wanted to do exactly what Murtaza suggests.
There are a couple of reasons why I think this capability would be useful. (And rereading Murtaza's email - I think this is what he meant)
1. The functions defined in hiccup and other libraries are not portable. if you rely on these, they will only work if the library maintained has copied the function interface exactly. This is not always the case. (as a separate comment these utility functions
would be better separated from the rendering code).
2. I would be great to write markup that describes your domain, not HTML so
[:address :street "here" :city "there"]
rather than [:div ....lots of html specific bits ... street...]
3. It would be great to be able to switch the rendering of your domain without editing the overall markup structure.
4. if webcomponents take off - which I hope they do - you may be able to gracefully transition by disabling the various tag rewriting again, not touching the main markup logic.
So I had a look to see if this can be done - and it can - relatively easily.
I implemented it the easiest way initially - but there are alternative possibilities for how this might work. Currently it uses a multimethod - but it might be better to pass in "tag expanding functions" when rendering - this would be more flexible.
The changes to hiccup to achieve this are quite minor.
I added a basic repl example file
A nice thing here is that incompatibilities between hiccup and cljs equivalents could be mitigated if we could agree on a "standard" for allowing custom tags.
Thoughts anyone?
Dave