aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html_generation.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 15:32:30 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 15:32:30 +0000
commit93c52cf6be9633f97e903233db47648844407d2e (patch)
treef7a27832e8672cbdf5500598c9f91ba1701e7762 /mammoth/html_generation.py
parentde040b5c92e20d0b578be0cc4b63e032ae5698bc (diff)
Generate class attribute when satisfying HTML path
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):