From db27df36d2ea42dd20f275e9b9d6fe15f1a960f8 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Mon, 5 Feb 2024 10:06:34 -0800 Subject: [PATCH] Escape triple quotes when creating `space.py` for custom components (#7290) * escape triple quotes when creating space.py for custom components * add changeset --------- Co-authored-by: gradio-pr-bot --- .changeset/light-lemons-shout.md | 5 +++++ gradio/cli/commands/components/_docs_utils.py | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/light-lemons-shout.md diff --git a/.changeset/light-lemons-shout.md b/.changeset/light-lemons-shout.md new file mode 100644 index 000000000000..34bfe0471beb --- /dev/null +++ b/.changeset/light-lemons-shout.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +fix:Escape triple quotes when creating `space.py` for custom components diff --git a/gradio/cli/commands/components/_docs_utils.py b/gradio/cli/commands/components/_docs_utils.py index 0d9d3fd9c93f..428fbe98a416 100644 --- a/gradio/cli/commands/components/_docs_utils.py +++ b/gradio/cli/commands/components/_docs_utils.py @@ -837,6 +837,7 @@ def make_space( To ignore this error pass `--suppress-demo-check` to the docs command.""" ) + demo = demo.replace('"""', '\\"\\"\\"') source = """ import gradio as gr