block math is in <span>, not <div>
Created originally on Bitbucket by cedricvanrompay (Cédric VAN ROMPAY)
When using docutils writer, a .. math::
block results in math being in a <div>
, and the math formula is centered on the web page.
With rst2html5
however, block math is in a <span>
and does not appear centered by default.
#!python
import docutils.core
import rst2html5_
SRC = """\
TITLE
=======
Some block math:
.. math::
\sqrt{x}
"""
params = {
'math_output': 'MathJax'
}
body_ext_lib = docutils.core.publish_parts(
writer=rst2html5_.HTML5Writer(),
source=SRC,
settings_overrides=params,
)["body"]
body_docutils = docutils.core.publish_parts(
writer_name='html5',
source=SRC,
settings_overrides=params,
)["body"]
Then:
>>> print(body_ext_lib)
<h1>TITLE</h1>
<p>Some block math:</p>
<span class="math">\(\sqrt{x}\)</span>
>>> print(body_docutils)
<p>Some block math:</p>
<div class="math">
\begin{equation*}
\sqrt{x}
\end{equation*}
</div>
Is this normal ?