# -*- coding: utf-8 -*-
h = open(r"D:\work buddy\2026-11-05-14-15-52\index_main.html", "r", encoding="utf-8").read()
# Find broken spot: dartmouth-computer-science-ms.html" followed by { without comma
needle = 'dartmouth-computer-science-ms.html"}{'
i = h.find(needle)
print("Broken at offset:", i)
if i >= 0:
    print("Context:", repr(h[i-30:i+120]))
    # Fix: insert comma between } and {
    h = h[:i+len('dartmouth-computer-science-ms.html"')] + ',' + h[i+len('dartmouth-computer-science-ms.html"'):]
    open(r"D:\work buddy\2026-11-05-14-15-52\index_main.html", "w", encoding="utf-8").write(h)
    print("Fixed: inserted comma")
else:
    # Try broader search
    import re
    for m in re.finditer(r'"}\s*\{', h):
        print("Found } { at", m.start(), repr(h[m.start()-40:m.end()+40]))
