AlserFurma commited on
Commit
e7ba8c1
·
verified ·
1 Parent(s): de7134b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -222,9 +222,12 @@ def generate_interactive_lesson(text, video_path):
222
  </html>
223
  """
224
 
225
- # HTML для кнопки открытия в новой вкладке (экранируем `)
 
 
 
226
  open_button_html = f"""
227
- <button onclick="var w = window.open(); w.document.write(`{html.replace('`', '\\`').replace('$', '\\$')}`);">Интерактивті сабақты жаңа қойындыда ашу</button>
228
  """
229
 
230
  return open_button_html
 
222
  </html>
223
  """
224
 
225
+ # Экранируем специальные символы вне f-строки
226
+ escaped_html = html.replace('`', r'\`').replace('$', r'\$')
227
+
228
+ # HTML для кнопки открытия в новой вкладке
229
  open_button_html = f"""
230
+ <button onclick="var w = window.open(); w.document.write(`{escaped_html}`);">Интерактивті сабақты жаңа қойындыда ашу</button>
231
  """
232
 
233
  return open_button_html