diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-14 15:32:30 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-14 15:32:30 +0000 |
| commit | 93c52cf6be9633f97e903233db47648844407d2e (patch) | |
| tree | f7a27832e8672cbdf5500598c9f91ba1701e7762 /mammoth | |
| parent | de040b5c92e20d0b578be0cc4b63e032ae5698bc (diff) | |
Generate class attribute when satisfying HTML path
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/html_generation.py | 5 |
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): |
