def extract_citations(text: str) -> list[str]:
    """
    Extract citation IDs enclosed in brackets like [abc1234].
    Returns a list of citation IDs.

    Args:
        text: The text to search for citations. If None, returns an empty list.

    Returns:
        List of citation IDs matching the pattern [A-Za-z0-9]{7,8}
    """
    # Handle None or empty input
    if text is None or text == "":
        return []

    # Direct pattern to match IDs inside brackets with alphanumeric pattern
    CITATION_PATTERN = re.compile(r"\[([A-Za-z0-9]{7,8})\]")

    sids = []
    for match in CITATION_PATTERN.finditer(text):
        sid = match.group(1)
        sids.append(sid)

    return sids

    Extract citation IDs enclosed in brackets like [abc1234].
    Returns a list of citation IDs.

    Args:
        text: The text to search for citations. If None, returns an empty list.

    Returns:
        List of citation IDs matching the pattern [A-Za-z0-9]{7,8}
    
py/core/utils/__init__.py