def split_frontmatter(text):
    """Separates the frontmatter (between '---') and determines the text mode"""
    frontmatter = []
    markdown = []
    curr = None
    mode = None
    for line in text.split("\n"):
        if line.startswith("---"):
            curr = frontmatter if not frontmatter else markdown
            continue
        elif "blocktype:" in line:
            mode = "bullets" if "bullets" in line else "text"
            continue
        if curr is not None:
            curr.append(line)
    # This leads into the markdown material, specifying block text with a pipe if needed
    modetag = " |" if mode == "text" else ""
    frontmatter.append(f"content:{modetag}")
    return frontmatter, markdown, mode