INNER CODE UNIT · Python
parse_entries
crocs-muni/javacard-curated-list · scripts/process_curated_list.py:82
def parse_entries(markdown_text):
lines = markdown_text.split("\n")
category = None
subcategory = None
entries = []
i = 0
n = len(lines)
while i < n:
line = lines[i]
if line.startswith("## "):
category = line[3:].strip()
subcategory = None
i += 1
continue
if line.startswith("### "):
subcategory = line[4:].strip()
i += 1