def highlight_spelling_errors(token, words, is_correct):
    """
    Wrap bad words in <em> tags.
    :param token: e.g. SomethingWorng
    :param words: e.g. ['something', 'worng']
    :param is_correct: e.g. [True, False]
    :return: e.g. 'Something<em>Worng</em>'
    """
    result = token
    lowercase_result = result.lower()
    index = 0
    for w, i in zip(words, is_correct):
        index = lowercase_result.find(w, index)
        if not i:
            result = ''.join((result[:index], '<em>', result[index:index +
                len(w)], '</em>', result[index + len(w):]))
            lowercase_result = result.lower()
            index += 9
    return result
