diff options
Diffstat (limited to 'mammoth/images.py')
| -rw-r--r-- | mammoth/images.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mammoth/images.py b/mammoth/images.py new file mode 100644 index 0000000..713f739 --- /dev/null +++ b/mammoth/images.py @@ -0,0 +1,9 @@ +def inline(func): + def convert_image(image, html_generator): + attributes = func(image).copy() + if image.alt_text: + attributes["alt"] = image.alt_text + + html_generator.self_closing("img", attributes) + + return convert_image |
