# -*- coding: utf-8 -*-
"""Fix VD: remove the 5 stray chars 't','s','i','i','u' and append correct urls."""
import os, re
ROOT = r"D:\work buddy\2026-11-05-14-15-52"
IDX = os.path.join(ROOT, "index_main.html")

html = open(IDX, encoding="utf-8").read()

# Remove the bad segment
bad = ',"t","s","i","i","u")'
good = ',"details/nu-ms-matsci.html","details/nu-ms-cee.html","details/umich-mse-enve.html","details/umich-ms-clasp.html","details/geo-ms-bmb.html")'
assert bad in html, "bad segment not found"
html = html.replace(bad, good)
open(IDX, "w", encoding="utf-8").write(html)
print("[FIXED] VD stray chars replaced with correct urls")
