with open('index_main.html','r',encoding='utf-8') as f:
    html = f.read()

# 修复 1: 去掉双逗号 ",,\n\"details/gatech-ae-phd"
old1 = '"details/ubc-mppga.html",,\n"details/gatech-ae-phd.html"'
new1 = '"details/ubc-mppga.html",\n"details/gatech-ae-phd.html"'
assert old1 in html, "old1 not found"
html = html.replace(old1, new1)

# 修复 2: 新 VD 条目最后一个后面补逗号
old2 = '"details/ucla-mae-phd.html"\n"details/ucla-stats-ms.html"'
new2 = '"details/ucla-mae-phd.html",\n"details/ucla-stats-ms.html"'
assert old2 in html, "old2 not found"
html = html.replace(old2, new2)

with open('index_main.html','w',encoding='utf-8') as f:
    f.write(html)

print("Fixed VD insertion syntax")
print("File size:", len(html))
