Here's just a generic div with some nonsense math in it. Does not render properly
div [] [ math [] [text "$\\int_a^b \frac{2}{3}$"]
and here's what comes out
<math>$\int_a^b \frac{2}{3}$</math>
so I am not understanding how math
works in Elm. This is looking like mathML
For the time being, I would think it easier to make a mathjax call than to learn (or create) a new markup language and write pure mathML. Here's what it should look like
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msubsup>
<mo>∫<!-- ∫ --></mo>
<mi>a</mi>
<mi>b</mi>
</msubsup>
<mfrac>
<mn>2</mn>
<mn>3</mn>
</mfrac>
</math>
Elm has no mfrac
tag, but I'd be glad to write in my own! This set of tags is being used on the web with growing freqency, but may not have been adopted by Elm-Lang itself just yet.
Elm does expose node
where you can define your own tag of any kind.
node
: String
-> List (Attribute msg)
-> List (Html msg)
-> Html msg
This indicated a potential solution. Didn't lead anywhere though:
node "math" [] [ node "mo" [] [ text "∫"] ]