-
Notifications
You must be signed in to change notification settings - Fork 11
Description
It would be cool if an escape hatch could be provided in the API, to allow custom processing, similar to how many markdown transformers work. The mathup() JS API would accept a handler callback parameter, which accepts the escaped string as input and returns a processed string as output.
Since <mtext> element allows arbitrary html markup to be included, it would be an ideal way to provide escapes.
For example, with
A = "some text"/2
the mathup API would call the handler with "some text" as input, and the handler could return any html string as output. That output string would be plugged into the output of mathup verbatim.
For example, if the handler returned <em>some text</em> that would get embedded into the mathup output:
<mfrac><mtext><em>some text</em></mtext><mn>2</mn></mfrac>
A more complex example I have in mind is, to mask some parts of the math expression, for learning purposes.
Another example is to provide a tool tip help for some parts of the expression.
The possibilities are endless.