someone-in-the-world Claude Sonnet 4.6 commited on
Commit
ce260d2
·
1 Parent(s): b122899

Fix quick prompt buttons: HTML-escape JSON to avoid breaking onclick attribute

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -156,7 +156,7 @@ def load_example_data(idx_str):
156
  def build_suggestion_chips_html():
157
  chips = []
158
  for s in SUGGESTIONS_CONFIG:
159
- prompt_json = json.dumps(s["prompt"])
160
  label = html_lib.escape(s["label"])
161
  chips.append(f'<button class="suggestion-chip" onclick="window.__setPrompt({prompt_json})">{label}</button>')
162
  return "".join(chips)
 
156
  def build_suggestion_chips_html():
157
  chips = []
158
  for s in SUGGESTIONS_CONFIG:
159
+ prompt_json = html_lib.escape(json.dumps(s["prompt"]))
160
  label = html_lib.escape(s["label"])
161
  chips.append(f'<button class="suggestion-chip" onclick="window.__setPrompt({prompt_json})">{label}</button>')
162
  return "".join(chips)