def METHOD_NAME(self, tab_section: Dict[str, Any], lines: List[str]) -> str:
    tab_content_blocks = []
    for index, tab in enumerate(tab_section["tabs"]):
        start_index = tab["start"] + 1
        try:
            # If there are more tabs, we can use the starting index
            # of the next tab as the ending index of the previous one
            end_index = tab_section["tabs"][index + 1]["start"]
        except IndexError:
            # Otherwise, just use the end of the entire section
            end_index = tab_section["end_tabs_index"]
        content = "\n".join(lines[start_index:end_index]).strip()
        tab_content_block = DIV_TAB_CONTENT_TEMPLATE.format(
            data_tab_key=tab["tab_key"],
            # Wrapping the content in two newlines is necessary here.
            # If we don't do this, the inner Markdown does not get
            # rendered properly.
            content=f"\n{content}\n",
        )
        tab_content_blocks.append(tab_content_block)
    return "\n".join(tab_content_blocks)