INNER CODE UNIT · Python
parse_table
sangrokjung/claude-forge · scripts/md-to-docx/convert.py:560
def parse_table(lines: List[str], start_idx: int) -> Tuple[List[str], List[List[str]], int]:
"""테이블 파싱"""
header_line = lines[start_idx]
headers = [h.strip() for h in header_line.strip('|').split('|')]
# Skip separator
idx = start_idx + 2
rows = []
while idx < len(lines) and lines[idx].strip().startswith('|'):
row_line = lines[idx]
row_data = [cell.strip() for cell in row_line.strip('|').split('|')]
rows.append(row_data)
idx += 1
return headers, rows, idx