def METHOD_NAME(markdown_text: str, file_name: str) -> list[MarkdownBlock]:
    """
    拆分 Markdown 文档为段落
    """
    markdown_text = markdown_text.replace("\r\n", "\n").replace("\r", "\n")
    # 文档标题
    title = ""
    lines = markdown_text.split("\n")
    # markdown 段落
    blocks: list[MarkdownBlock] = []
    # 当前二级标题
    current_header = None
    current_content: list[BlockContent] = []
    # 代码需要合并到一起，所以先收集
    current_code: list[str] = []
    # 是否在代码快中
    in_code_block = False
    # 文档元数据
    in_meta = False
    for line in lines:
        # 处理文档元数据
        if line.startswith("---"):
            in_meta = not in_meta
            continue
        if in_meta and ":" in line:
            key, value = line.split(":")
            if key == "title":
                title = value.strip()
            continue
        # 这是版本说明，没什么用
        if line.startswith("> ") and "以上版本" in line:
            continue
        if line.startswith(">"):
            line = line.replace(">", "")
        if line.strip() == "":
            continue
        header_match = re.match(r"^#+\s", line)
        # 匹配到了标题
        if header_match:
            # 如果之前有标题，那么这就是新的一段
            if current_header is not None:
                # 至少要有内容或者代码块
                if len(current_content) > 0:
                    blocks.append(MarkdownBlock(file_name, title,
                                                current_header, current_content))
                    current_content = []
                    current_code = []
            # 开启新段落解析
            current_header = line
        else:
            # 说明是刚开始的文本，没有标题
            if current_header is None:
                current_content.append(BlockContent(ContentType.Text, line))
                blocks.append(MarkdownBlock(file_name, title,
                                            current_header, current_content))
                current_content = []
            else:
                # 说明是代码块
                if line.startswith("```"):
                    in_code_block = not in_code_block
                    if not in_code_block:
                        current_content.append(BlockContent(
                            ContentType.Code, "\n".join(current_code)))
                        current_code = []
                else:
                    if in_code_block:
                        current_code.append(line)
                    else:
                        current_content.append(
                            BlockContent(ContentType.Text, line))
    if len(current_content) > 0 or len(current_code) > 0:
        blocks.append(MarkdownBlock(file_name, title,
                                    current_header, current_content))
    return blocks