Hey Paul, nice to hear you raise this!
I fully agree it should be possible for some JS code such as MathJax to copy MathML to clipboard. The reason it is not listed as a mandatory data type, I believe, is that I, at least, have been unable to demonstrate the zero risk of doing so. I believe I have tried, although this spec has been running since quite long and things maybe have been changed. Putting html in the clipboard is a requirement and there's a subtle and unspecified (yet) way of "sanitizing" the fragments so that it does not represent a risk when inserted in another context. Recent discussions have emerged about this. All of the browsers which implement html-copying have their own implementation. Doing the same for MathML, e.g. removing maction, or, at least, any html-sensitive things should be needed. I do not know it is done. Halvord Steen, the editor of this spec, and others might correct me but I interpret that this is the reason it is not in the required types. I would be happy if we can formulate such a thing in a convincing way. Paul > 10. Mandatory data types > > I am surprised not to see a MathML type in this list. I suppose MathML could > be typed as application/xml but SVG gets its own image/svg+xml type so I > would expect MathML to be treated in an analogous manner. I will admit to not > knowing the ramifications of this. > > I also want to mention MathJax (www.mathjax.org). MathJax is an open source > JavaScript engine for rendering MathML and LaTeX in browsers. It could be > looked at as a polyfill for the current lack of good browser support for > MathML. However, it also has its own UI and processes LaTeX so it will > definitely have a place even after browsers routinely render MathML. > > I mention MathJax here as it is a good use case for the clipboard API. It > transforms MathML or LaTeX in the web page to a chunk of renderable HTML, > CSS, SVG, or even MathML if the browser supports it natively. The user would > like to be able to select, cut, copy, and paste a mathematical expression > rendered this way as if it was a single object. It sounds like MathJax should > be able to do this using this clipboard API, though it does not address the > selection aspect. Taking this a step further, someday we might hope to allow > the user to select sub-expressions of a mathematical equation for the purpose > of cut and copy. > > Paul Topping > Design Science, Inc.