def link_fix(text, name_dict):
    """
    Replace old file names with new in markdown links.
    """
    new_text = text
    for old, new in name_dict.items():
        new_text = new_text.replace(f']({old})', f']({new})')
    return new_text