X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/5f92f5a341c58a30c0a5c0d64ba3ed498bb9db85..a1eee7c004e2068b705bb4475633f76f2e38b4c4:/librarian/embeds/mathml.py?ds=sidebyside diff --git a/librarian/embeds/mathml.py b/librarian/embeds/mathml.py index f99f979..bd58baf 100644 --- a/librarian/embeds/mathml.py +++ b/librarian/embeds/mathml.py @@ -1,10 +1,15 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + from lxml import etree +import six from librarian import get_resource -from . import TreeEmbed, create_embed, downgrades_to, converts_to +from . import TreeEmbed, create_embed, downgrades_to + class MathML(TreeEmbed): @downgrades_to('application/x-latex') def to_latex(self): xslt = etree.parse(get_resource('res/embeds/mathml/mathml2latex.xslt')) output = self.tree.xslt(xslt) - return create_embed('application/x-latex', data=unicode(output)) + return create_embed('application/x-latex', data=six.text_type(output))