diff options
Diffstat (limited to 'mammoth')
| -rw-r--r-- | mammoth/writers/markdown.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mammoth/writers/markdown.py b/mammoth/writers/markdown.py index 10550d4..4aa73d5 100644 --- a/mammoth/writers/markdown.py +++ b/mammoth/writers/markdown.py @@ -34,6 +34,12 @@ def _hyperlink(attributes): return _default_output +def _image(attributes): + src = attributes.get("src") + alt_text = attributes.get("alt") + return _WriterOutput("".format(alt_text, src), "") + + def _init_writers(): writers = { "p": _Wrapped("", "\n\n"), @@ -41,6 +47,7 @@ def _init_writers(): "strong": _symmetric_wrapped("__"), "em": _symmetric_wrapped("*"), "a": _hyperlink, + "img": _image, } for level in range(1, 7): |
