We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
escapeStringForJson
1 parent 04a8669 commit b7269c5Copy full SHA for b7269c5
packages/tasks/src/model-libraries-snippets.ts
@@ -9,7 +9,7 @@ function nameWithoutNamespace(modelId: string): string {
9
return splitted.length === 1 ? splitted[0] : splitted[1];
10
}
11
12
-const escapeQuotes = (str: string): string => JSON.stringify(str);
+const escapeStringForJson = (str: string): string => JSON.stringify(str);
13
14
//#region snippets
15
@@ -76,7 +76,7 @@ function get_base_diffusers_model(model: ModelData): string {
76
function get_prompt_from_diffusers_model(model: ModelData): string | undefined {
77
const prompt = (model.widgetData?.[0] as WidgetExampleTextInput).text ?? model.cardData?.instance_prompt;
78
if (prompt) {
79
- return escapeQuotes(prompt);
+ return escapeStringForJson(prompt);
80
81
82
0 commit comments