Skip to content

Commit 1813d38

Browse files
committed
refactor: reuse toml escape helper for prompt fallback
1 parent b8edb60 commit 1813d38

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

src/specify_cli/agents.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,7 @@ def render_toml_command(
210210
toml_lines.append(body)
211211
toml_lines.append("'''")
212212
else:
213-
escaped_body = (
214-
body.replace("\\", "\\\\")
215-
.replace('"', '\\"')
216-
.replace("\n", "\\n")
217-
.replace("\r", "\\r")
218-
.replace("\t", "\\t")
219-
)
220-
toml_lines.append(f'prompt = "{escaped_body}"')
213+
toml_lines.append(f"prompt = {self._render_basic_toml_string(body)}")
221214

222215
return "\n".join(toml_lines)
223216

0 commit comments

Comments
 (0)