aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/html_generation.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py
index f31b2d3..13b0fc6 100644
--- a/mammoth/html_generation.py
+++ b/mammoth/html_generation.py
@@ -1,7 +1,6 @@
from __future__ import unicode_literals
import cgi
-import sys
class HtmlGenerator(object):
@@ -72,8 +71,8 @@ def _generate_attribute_string(attributes):
return ""
else:
return "".join(
- ' {0}="{1}"'.format(key, _escape_html(value))
- for key, value in _iteritems(attributes)
+ ' {0}="{1}"'.format(key, _escape_html(attributes[key]))
+ for key in sorted(attributes)
)
@@ -107,11 +106,3 @@ def _is_element_match(generated_element, path_element):
def _generate_class_attribute(path_element):
return " ".join(path_element.class_names)
-
-
-if sys.version_info[0] == 2:
- _iteritems = lambda x: x.iteritems()
-
-else:
- _iteritems = lambda x: x.items()
-