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


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

# Undocumented, but retained for backwards-compatibility with 0.3.x
inline = img_element