def group_posts(lines):
    """
    Return list of posts and within each post a list of its lines.
    """
    posts = []
    post = []
    lines.append('### ')
    for line in lines:
        if line.startswith('### '):
            posts.append(post)
            post = [line]
        else:
            post.append(line)
    return posts