Skip to content

Commit f2d223f

Browse files
KianNHRebeccaTamachiro
authored andcommitted
[Docs Site] Escape single quotes in CURL component JSON (#21559)
1 parent d424504 commit f2d223f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/CURL.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (json) {
3838
const jsonLines = JSON.stringify(json, null, "\t\t").split("\n");
3939
jsonLines[jsonLines.length - 1] = "\t" + jsonLines[jsonLines.length - 1];
4040
41-
lines.push(`\t--json '${jsonLines.join("\n")}'`);
41+
lines.push(`\t--json '${jsonLines.join("\n").replaceAll("'", "'\\''")}'`);
4242
}
4343
4444
if (form) {

src/content/docs/style-guide/components/curl.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { CURL } from "~/components";
2121
url="https://httpbin.org/anything"
2222
method="POST"
2323
json={{
24-
key: "value",
24+
key: "va'l'ue",
2525
}}
2626
code={{
2727
mark: "value"

0 commit comments

Comments
 (0)