diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-03-14 20:46:13 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-03-14 20:46:13 +0000 |
| commit | 2c57c1014ae8e44e62021ea2cc36c54352389632 (patch) | |
| tree | 323783d8b772535dddfd54e1342fce8fe4e4d636 /mammoth/images.py | |
| parent | b34f7280c0754f9fc88725358e22ac46d9a2a598 (diff) | |
Implement collapsing using HTML AST
Diffstat (limited to 'mammoth/images.py')
| -rw-r--r-- | mammoth/images.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mammoth/images.py b/mammoth/images.py index 713f739..3def424 100644 --- a/mammoth/images.py +++ b/mammoth/images.py @@ -1,9 +1,12 @@ +from . import html + + def inline(func): - def convert_image(image, html_generator): + def convert_image(image): attributes = func(image).copy() if image.alt_text: attributes["alt"] = image.alt_text - html_generator.self_closing("img", attributes) + return [html.self_closing_element("img", attributes)] return convert_image |
