Skip to content

Block attribute after math block not consistently handled #533

Description

@luc-j-bourhis

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions