def handle_svg(element, box, get_image_from_uri, base_url):
    """Handle ``<svg>`` elements.

    Return either an image or the fallback content.

    """
    # TODO: handle href base for inline svg tags
    url_fetcher = get_image_from_uri.keywords['url_fetcher']
    context = get_image_from_uri.keywords['context']
    try:
        image = SVGImage(element, base_url, url_fetcher, context)
    except Exception as exception:  # pragma: no cover
        LOGGER.error('Failed to load inline SVG: %s', exception)
        LOGGER.debug('Error while loading inline SVG:', exc_info=exception)
        return []
    else:
        return [make_replaced_box(element, box, image)]
Handle ``<svg>`` elements.

Return either an image or the fallback content.
weasyprint/html.py