aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html_generation.py
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth/html_generation.py')
-rw-r--r--mammoth/html_generation.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py
index 66f2719..a4d716e 100644
--- a/mammoth/html_generation.py
+++ b/mammoth/html_generation.py
@@ -74,7 +74,10 @@ def satisfy_html_path(generator, path):
generator.end()
for element in path.elements[first_unsatisfied_index:]:
- generator.start(element.names[0])
+ attributes = {}
+ if element.class_names:
+ attributes["class"] = " ".join(element.class_names)
+ generator.start(element.names[0], attributes=attributes)
def _find_first_unsatisfied_index(generator, path):