from typing import MutableMapping


def _toc_enabled(env: MutableMapping) -> bool:
    """Is there a valid ToC definition in the Markdown?"""
    opts = env["mdformat-toc"]["opts"]
    return bool(opts)