The following code
require 'kramdown'
text = <<END
This is an example of math
$$\\nabla\\cdot E = \\rho$$
{: .autotag}
and the rest follows.
END
math_eng = 'mathjax'
#math_eng = 'katex'
puts Kramdown::Document.new(text, :math_engine => math_eng).to_html
produces the following output when math_eng == 'mathjax'
<p>This is an example of math</p>
<script type="math/tex; mode=display">\nabla\cdot E = \rho</script>
<p>and the rest follows.</p>
and the following output when math_eng = 'katex'
<p>This is an example of math</p>
<div class="autotag kdmath">$$
\nabla\cdot E = \rho
$$</div>
<p>and the rest follows.</p>
I do realise that a class can't be set for a <script> tag in the Mathjax case but still I find it a problem that the class just disappears like that. Anything would be better than the current situation really!
This is with Kramdown version 1.17.0
The following code
produces the following output when
math_eng == 'mathjax'and the following output when
math_eng = 'katex'I do realise that a
classcan't be set for a<script>tag in the Mathjax case but still I find it a problem that the class just disappears like that. Anything would be better than the current situation really!This is with Kramdown version 1.17.0