import os
import re

files_to_update = ['index.html', 'about.html', 'gallery.html']
base_dir = 'd:\\iss\\Franciscan Society'

svg_arrow = '<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: text-bottom;"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg>'

for file_name in files_to_update:
    path = os.path.join(base_dir, file_name)
    if os.path.exists(path):
        with open(path, 'r', encoding='utf-8') as f:
            content = f.read()
        
        # Replace the HTML entity with the SVG
        updated_content = content.replace('&#8599;', svg_arrow)
        
        with open(path, 'w', encoding='utf-8') as f:
            f.write(updated_content)
        print(f"Fixed arrows in {file_name}")
