def escape(html):
    """
    Returns the given HTML with ampersands, quotes and angle brackets encoded.
    """
    return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;'
        ).replace('"', '&quot;').replace("'", '&#39;')
