import re


def make_tags_xml_compliant(html):
    """Make sure, the tags are proper XML.

    Converts <img ... > to <img ... />. (Same for <br>)

    We do not handle the case where there is an opening
    and an closing tag, for example <br></br> as it is
    not very common.

    Args:
        html (text): the html text

    Returns:
      text: the fixed html text
    """
    tags = ['img', 'br']
    for tag in tags:
        def check_and_fix(m):
            s = m.group(1)
            if not s.lstrip().startswith(tag):
                return m.group(0)
            check_match = re.search(r'/\s*$', s)
            if check_match:
                return m.group(0)
            else:
                return '<' + s + '/>'
        html = re.sub(r'<(.*?)>', check_and_fix, html)
    return html