mishig HF staff commited on
Commit
3b4a9b6
·
1 Parent(s): b7b9835

escape http snippets

Browse files
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte CHANGED
@@ -196,7 +196,7 @@ print(output.choices[0].message)`,
196
  const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>
197
  start +
198
  getMessages()
199
- .map(({ role, content }) => `{ "role": "${role}", "content": "${content}" }`)
200
  .join(sep) +
201
  end;
202
 
 
196
  const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>
197
  start +
198
  getMessages()
199
+ .map(({ role, content }) => `{ "role": "${role}", "content": "${content?.replace(/"/g, '\\"')}" }`)
200
  .join(sep) +
201
  end;
202