</g>
</svg> should be part of a new paragraph, not stuck out of it. The following formula has a custom environment:</p><div class="m-math"><svg style="width: 11.926em; height: 4.028em;" viewBox="136.775 -38.6648 114.495 38.6648">
<title>
-\begin{eqnarray*} g &=& \frac{Gm_2}{r^2} \\ &=& 9.82066032\,\mbox{m/s}^2 \end{eqnarray*}
+\begin{eqnarray*} g &=& \frac{Gm_2}{r^2} \\ &=& 9.82066032\,\mbox{m/s}^2 \end{eqnarray*}
</title>
<defs>
<path d='M2.19975 -0.573848C2.19975 -0.920548 1.91283 -1.15965 1.6259 -1.15965C1.2792 -1.15965 1.0401 -0.872727 1.0401 -0.585803C1.0401 -0.239103 1.32702 0 1.61395 0C1.96065 0 2.19975 -0.286924 2.19975 -0.573848Z' id='eq5-g0-58'/>
# DEALINGS IN THE SOFTWARE.
#
+import html
import pickle
import re
from hashlib import sha1
style=style,
viewBox=match.group('viewBox'),
attribs=attribs,
- formula=formula)
+ formula=html.escape(formula))
return _unique_src.sub(_unique_dst.format(counter=counter), _patch_src.sub(repl, svg))
# DEALINGS IN THE SOFTWARE.
#
+import html
import os
import re
# Fallback rendering as code requested
if render_as_code:
- content = nodes.raw('', '\n'.join(self.content), format='html')
+ content = nodes.raw('', html.escape('\n'.join(self.content)), format='html')
pre = nodes.literal_block('')
pre.append(content)
return [pre]
classes += options['classes']
del options['classes']
- content = nodes.raw('', utils.unescape(text), format='html')
+ content = nodes.raw('', html.escape(utils.unescape(text)), format='html')
node = nodes.literal(rawtext, '', **options)
node.append(content)
return [node], []
the lines <code>W = \sum_{i=0}^{n} \frac{w_i}{h_i}</code> because
<code>Y = \sum_{i=0}^{n} B</code></p>
<p>The <code>\cfrac</code> thing doesn't align well: <code>W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}</code></p>
+<p>Properly escape the formula source:</p>
+<pre>\begin{array}{rcl}
+ x & = & 1
+\end{array}</pre>
<!-- /content -->
</div>
</div>
<use x='65.9862' xlink:href='#eq7-g1-105' y='9.99393'/>
</g>
</svg></p>
+<p>Properly escape the formula source:</p>
+<div class="m-math">
+<svg style="width: 4.327em; height: 0.803em;" viewBox="173.504 -12.0382 41.535 7.70444">
+<title>
+\begin{array}{rcl}
+ x & = & 1
+\end{array}
+</title>
+<defs>
+<path d='M5.66675 -4.87771C5.28418 -4.80598 5.14072 -4.51905 5.14072 -4.29191C5.14072 -4.00498 5.36787 -3.90934 5.53524 -3.90934C5.8939 -3.90934 6.14496 -4.22017 6.14496 -4.54296C6.14496 -5.04508 5.57111 -5.27223 5.06899 -5.27223C4.33973 -5.27223 3.93325 -4.55492 3.82565 -4.32777C3.55068 -5.22441 2.80946 -5.27223 2.59427 -5.27223C1.37484 -5.27223 0.729265 -3.7061 0.729265 -3.44309C0.729265 -3.39527 0.777086 -3.33549 0.860772 -3.33549C0.956413 -3.33549 0.980324 -3.40722 1.00423 -3.45504C1.41071 -4.78207 2.21171 -5.03313 2.55841 -5.03313C3.09639 -5.03313 3.20399 -4.53101 3.20399 -4.24408C3.20399 -3.98107 3.13225 -3.7061 2.98879 -3.13225L2.58232 -1.4944C2.40299 -0.777086 2.05629 -0.119552 1.42267 -0.119552C1.36289 -0.119552 1.06401 -0.119552 0.812951 -0.274969C1.24334 -0.358655 1.33898 -0.71731 1.33898 -0.860772C1.33898 -1.09988 1.15965 -1.24334 0.932503 -1.24334C0.645579 -1.24334 0.334745 -0.992279 0.334745 -0.609714C0.334745 -0.107597 0.896638 0.119552 1.41071 0.119552C1.98456 0.119552 2.39103 -0.334745 2.64209 -0.824907C2.83337 -0.119552 3.43113 0.119552 3.87347 0.119552C5.0929 0.119552 5.73848 -1.44658 5.73848 -1.70959C5.73848 -1.76936 5.69066 -1.81719 5.61893 -1.81719C5.51133 -1.81719 5.49938 -1.75741 5.46351 -1.66177C5.14072 -0.609714 4.44732 -0.119552 3.90934 -0.119552C3.49091 -0.119552 3.26376 -0.430386 3.26376 -0.920548C3.26376 -1.18356 3.31158 -1.37484 3.50286 -2.16389L3.9213 -3.78979C4.10062 -4.5071 4.5071 -5.03313 5.05704 -5.03313C5.08095 -5.03313 5.41569 -5.03313 5.66675 -4.87771Z' id='eq8-g0-120'/>
+<path d='M3.44309 -7.66326C3.44309 -7.93823 3.44309 -7.95019 3.20399 -7.95019C2.91706 -7.6274 2.3193 -7.18506 1.08792 -7.18506V-6.83836C1.36289 -6.83836 1.96065 -6.83836 2.61818 -7.14919V-0.920548C2.61818 -0.490162 2.58232 -0.3467 1.53026 -0.3467H1.15965V0C1.48244 -0.0239103 2.64209 -0.0239103 3.03661 -0.0239103S4.57883 -0.0239103 4.90162 0V-0.3467H4.53101C3.47895 -0.3467 3.44309 -0.490162 3.44309 -0.920548V-7.66326Z' id='eq8-g1-49'/>
+<path d='M8.06974 -3.87347C8.23711 -3.87347 8.4523 -3.87347 8.4523 -4.08867C8.4523 -4.31582 8.24907 -4.31582 8.06974 -4.31582H1.02814C0.860772 -4.31582 0.645579 -4.31582 0.645579 -4.10062C0.645579 -3.87347 0.848817 -3.87347 1.02814 -3.87347H8.06974ZM8.06974 -1.64981C8.23711 -1.64981 8.4523 -1.64981 8.4523 -1.86501C8.4523 -2.09215 8.24907 -2.09215 8.06974 -2.09215H1.02814C0.860772 -2.09215 0.645579 -2.09215 0.645579 -1.87696C0.645579 -1.64981 0.848817 -1.64981 1.02814 -1.64981H8.06974Z' id='eq8-g1-61'/>
+</defs>
+<g id='eq8-page1'>
+<use x='173.504' xlink:href='#eq8-g0-120' y='-4.33378'/>
+<use x='190.119' xlink:href='#eq8-g1-61' y='-4.33378'/>
+<use x='209.186' xlink:href='#eq8-g1-49' y='-4.33378'/>
+</g>
+</svg></div>
<!-- /content -->
</div>
</div>
:math:`Y = \sum_{i=0}^{n} B`
The ``\cfrac`` thing doesn't align well: :math:`W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}`
+
+Properly escape the formula source:
+
+.. math::
+
+ \begin{array}{rcl}
+ x & = & 1
+ \end{array}