def altair_fix(html: str, i: int):
    """
    Replaces certain keywords in the JavaScript needed to show altair plots.
    Allows multiple altair plots to be rendered with vega on a single page
    """
    # convert beautiful soup tag to a string
    html = str(html)
    keywords = ["vis", "spec", "embed_opt", "const el"]
    for word in keywords:
        html = html.replace(word, f"{word}{str(i)}")
    return f'<div id="vis{i}"></div>\n' + html