I need to convert formulas from html to Asciidoc. Pandoc is not doing it right because I suppose I need to preprocess them somehow.
The source of the formula is like this:
<div id="d126e133489" class="mediaobject">
<div class="code_responsive">
<p class="programlistingindent">
<span>
<span class="MathEquation" style="font-size: 15px;">
<span class="MathRoot HBox" role="math" aria-label="L indexOf m underscore s a t baseline equals L indexOf m baseline" style="display: inline-block;">
<span class="MathRow HBox" style="display: inline-block; font-size: 15px;">
<span class="MathScript HBox" style="display: inline-block; font-size: 15px;">
<span class="MathRow HBox" style="display: inline-block; font-size: 15px;">
<span class="MathText MathTextBox mwEqnIdentifier">L</span>
</span>
<span class="VBox" style="display: inline-block; text-align: left; vertical-align: -2px;">
<span class="MathRow HBox" style="display: block; font-size: 10.5px; margin-left: 0px; margin-top: 0px;">
<span class="MathText MathTextBox mwEqnIdentifier">m</span>
<span class="MathText MathTextBox mwEqnSymbol">_</span>
<span class="MathText MathTextBox mwEqnIdentifier">sat</span>
</span>
</span>
</span>
<span class="MathText MathTextBox mwEqnSymbol" style="margin-left: 0.277778em;">=</span>
<span class="MathScript HBox" style="display: inline-block; font-size: 15px; margin-left: 0.277778em;">
<span class="MathRow HBox" style="display: inline-block; font-size: 15px;">
<span class="MathText MathTextBox mwEqnIdentifier">L</span>
</span>
<span class="VBox" style="display: inline-block; text-align: left; vertical-align: -2px;">
<span class="MathRow HBox" style="display: block; font-size: 10.5px; margin-left: 0px; margin-top: 0px;">
<span class="MathText MathTextBox mwEqnIdentifier">m</span>
</span>
</span>
</span>
</span>
</span>
</span>
</span>
</p>
</div>
</div>
It is rendered on the page like this:
and I want to get an asciimath or latexmath stem block for this formula as a result.
By default Pandoc is converting it to this:
[[d126e133489]]
[.MathEquation]#[.MathRoot .HBox]#[.MathRow .HBox]#[.MathScript .HBox]#[.MathRow .HBox]#[.MathText .MathTextBox .mwEqnIdentifier]#L##[.VBox]#[.MathRow .HBox]#[.MathText .MathTextBox .mwEqnIdentifier]#m#[.MathText .MathTextBox .mwEqnSymbol]#_#[.MathText .MathTextBox .mwEqnIdentifier]#sat####[.MathText .MathTextBox .mwEqnSymbol]#=#[.MathScript .HBox]#[.MathRow .HBox]#[.MathText .MathTextBox .mwEqnIdentifier]#L##[.VBox]#[.MathRow .HBox]#[.MathText .MathTextBox .mwEqnIdentifier]#m#######
Is there any way of preprocessing such formulas so that I get some valid stem blocks as a result after conversion via Pandoc? Or maybe I can convert them all instead of Pandoc myself but how?
