aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html_generation.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-17 15:05:19 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-17 15:05:19 +0100
commit147fabb2b2e00f7790304b7a1e1f40cdb564cb4f (patch)
treefcd72fdbdf3681acd1dff8dd6237143a80914cfa /mammoth/html_generation.py
parent35d3dd58400d5310fe05ebe8e070c96c756edac0 (diff)
Support underlines in style map
Diffstat (limited to 'mammoth/html_generation.py')
-rw-r--r--mammoth/html_generation.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py
index c7f4f38..e538f6e 100644
--- a/mammoth/html_generation.py
+++ b/mammoth/html_generation.py
@@ -68,12 +68,22 @@ def satisfy_html_path(generator, path):
generator.end()
for element in path.elements[first_unsatisfied_index:]:
- attributes = {}
- if element.class_names:
- attributes["class"] = _generate_class_attribute(element)
- generator.start(element.names[0], attributes=attributes)
+ _append_element(generator, element)
+
+
+def append_html_path(generator, path):
+ for element in path.elements:
+ _append_element(generator, element)
+
+
+def _append_element(generator, element):
+ attributes = {}
+ if element.class_names:
+ attributes["class"] = _generate_class_attribute(element)
+ generator.start(element.names[0], attributes=attributes)
+
def _find_first_unsatisfied_index(generator, path):
for index, (generated_element, path_element) in enumerate(zip(generator._stack, path.elements)):
if not _is_element_match(generated_element, path_element):