Questions about attribute substitution, treeprocessor, and builtin inline and inline macros.
First question... why would there be a difference in behavior? So far I haven't seen any difference in arguments or state, but I could easily have missed something.
I think an alternative implementation strategy would be for a tree processor to transform stem blocks and stem inline into block macro and inline block macro calls, and then let the converter call into these extensions. That is, along with the treeProcessor extension I'd register a MathJax block macro and MathJax inline block macro, and transform [stem] to [mathjax] and stem: to MathJax: (leaving out the details).
Second question.... is this likely to produce more fidelity with built-in stem processing?
Third question... why aren't the built in inline stuff that looks somewhat like inline macros, such as stem:, xref:, image:, already exposed as extension points, either as inline macros with a default implementation, or as additional extension types? Similarly, why doesn't [stem] appear as a block extension or a new kind of extension?
Fourth question... Could the Antora html5 converter be replaced by a treeProcessor that rewrites the inline stuff it modifies to call inline macros, e.g. xref >> antora-xref, together with appropriate inline macro extensions?