import codecs
import time

filepath = r'd:\cnf\chatbot-canifa-feedback\backend\static\fashion-matches\live-simulator.html'

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

count1 = text.count(r'\`')
count2 = text.count(r'\${')

print("Found escaped backticks:", count1)
print("Found escaped dollars:", count2)

text = text.replace(r'\`', '`').replace(r'\${', '${')

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

print("Fixed!")
