summaryrefslogtreecommitdiff
path: root/mammoth/images.py
blob: 3def4249a0dba2c6a814a0fefb487ee07cca8241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from . import html


def inline(func):
    def convert_image(image):
        attributes = func(image).copy()
        if image.alt_text:
            attributes["alt"] = image.alt_text
            
        return [html.self_closing_element("img", attributes)]
    
    return convert_image