aboutsummaryrefslogtreecommitdiff
path: root/mammoth/conversion.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-08-31 10:44:16 +0100
committerMichael Williamson <mike@zwobble.org>2014-08-31 10:44:16 +0100
commit045edf1c661b09957e4f87c37981b209a29512ae (patch)
tree3223ba0425a32fb98d7d639da7dbcbbfbcbae45c /mammoth/conversion.py
parent7145a7199033988065f472af5a964587acbe06eb (diff)
Fix support on different Python versions
Diffstat (limited to 'mammoth/conversion.py')
-rw-r--r--mammoth/conversion.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py
index c1299f6..0a91a1d 100644
--- a/mammoth/conversion.py
+++ b/mammoth/conversion.py
@@ -2,6 +2,7 @@
import base64
import random
+import sys
from . import documents, results, html_paths, images
from .html_generation import HtmlGenerator, satisfy_html_path
@@ -161,7 +162,7 @@ class DocumentConverter(object):
self._convert_elements_to_html(footnote.body, footnote_generator)
footnote_generator.text(" ")
footnote_generator.start("a", {"href": "#footnote-ref-{0}".format(uid)})
- footnote_generator.text(u"↑")
+ footnote_generator.text(_up_arrow)
footnote_generator.end_all()
html_generator.append(footnote_generator)
html_generator.end()
@@ -213,3 +214,7 @@ def _document_matcher_matches(matcher, element, element_type):
matcher.numbering == element.numbering
)
)
+
+_up_arrow = "↑"
+if sys.version_info[0] < 3:
+ _up_arrow = _up_arrow.decode("utf8")