Fixed MathML in EPUB.
[librarian.git] / src / librarian / embeds / mathml.py
index 564a9f4..16fa75b 100644 (file)
@@ -11,16 +11,21 @@ class MathML(TreeEmbed):
     @downgrades_to('application/x-latex')
     def to_latex(self):
         """
     @downgrades_to('application/x-latex')
     def to_latex(self):
         """
-        >>> print(MathML(etree.fromstring('<mat>a &lt; b</mat>')).to_latex().data.strip())
+        >>> print(MathML(etree.fromstring(
+        ...     '<mat>a &lt; b</mat>'
+        ... )).to_latex().data.strip())
         a < b
 
         a < b
 
-        >>> print(MathML(etree.fromstring('<mat>&lt; &amp; &amp;lt; &#65;</mat>')).to_latex().data.strip())
+        >>> print(MathML(etree.fromstring(
+        ...     '<mat>&lt; &amp; &amp;lt; &#65;</mat>'
+        ... )).to_latex().data.strip())
         < & &lt; A
 
         """
         xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt'))
         output = self.tree.xslt(xslt)
         text = six.text_type(output)
         < & &lt; A
 
         """
         xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt'))
         output = self.tree.xslt(xslt)
         text = six.text_type(output)
-        # Workaround for entities being preserved in output. But there should be a better way.
+        # Workaround for entities being preserved in output.
+        # But there should be a better way.
         text = text.replace('&lt;', '<').replace('&amp;', '&')
         return create_embed('application/x-latex', data=text)
         text = text.replace('&lt;', '<').replace('&amp;', '&')
         return create_embed('application/x-latex', data=text)