from bs4 import BeautifulSoup
from typing import Set


def parse_citeref_ids(soup: BeautifulSoup) -> Set[str]:
    """Parse Parsoid HTML and return html ids for citations"""
    ids = set()
    for element in soup.find_all(class_="citation"):
        el_id = element.get("id")
        if el_id and el_id.startswith("CITEREF"):
            ids.add(el_id)

    return ids