diff --git a/src/components/CURL.astro b/src/components/CURL.astro index 74c05a8011305e7..edcd52bdab3ac54 100644 --- a/src/components/CURL.astro +++ b/src/components/CURL.astro @@ -38,7 +38,7 @@ if (json) { const jsonLines = JSON.stringify(json, null, "\t\t").split("\n"); jsonLines[jsonLines.length - 1] = "\t" + jsonLines[jsonLines.length - 1]; - lines.push(`\t--json '${jsonLines.join("\n")}'`); + lines.push(`\t--json '${jsonLines.join("\n").replaceAll("'", "'\\''")}'`); } if (form) { diff --git a/src/content/docs/style-guide/components/curl.mdx b/src/content/docs/style-guide/components/curl.mdx index 68bf9bf2409f87a..b64e11167206fac 100644 --- a/src/content/docs/style-guide/components/curl.mdx +++ b/src/content/docs/style-guide/components/curl.mdx @@ -21,7 +21,7 @@ import { CURL } from "~/components"; url="https://httpbin.org/anything" method="POST" json={{ - key: "value", + key: "va'l'ue", }} code={{ mark: "value"