Skip to content

Commit b4584da

Browse files
committed
fix(pi): keep dialog titles literal with math enabled
1 parent abb40eb commit b4584da

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/provider-pi/src/server/adapter.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,13 +3345,13 @@ describe("PiAdapterV2", () => {
33453345
it.effect.each([
33463346
{
33473347
placeholder: undefined,
3348-
title: "Enter <branch> & [name] *exact*",
3349-
question: String.raw`Enter &lt;branch&gt; &amp; \[name\] \*exact\*`,
3348+
title: "Enter <branch> & [name] *exact* $PATH$",
3349+
question: "Enter &lt;branch&gt; &amp; &#91;name&#93; &#42;exact&#42; &#36;PATH&#36;",
33503350
},
33513351
{
33523352
placeholder: "",
33533353
title: "Where should this run?\n1. Current branch\n2. New worktree",
3354-
question: "Where should this run?\n1\\. Current branch\n2\\. New worktree",
3354+
question: "Where should this run?\n1&#46; Current branch\n2&#46; New worktree",
33553355
},
33563356
{ placeholder: "1,3; custom answer", title: "Enter a value", question: "Enter a value" },
33573357
])(
@@ -3427,7 +3427,7 @@ describe("PiAdapterV2", () => {
34273427
}
34283428
assert.equal(
34293429
decodeUserInputQuestions(event.turnItem.questions)[0]?.question,
3430-
"Which database?\n1\\. Postgres\n2\\. Type something\\.\nType your answer:",
3430+
"Which database?\n1&#46; Postgres\n2&#46; Type something&#46;\nType your answer:",
34313431
);
34323432
yield* runtime.respondToRuntimeRequest({
34333433
requestId: event.turnItem.requestId,

‎packages/provider-pi/src/server/adapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3335,7 +3335,7 @@ function piQuestion(
33353335
.replace(/&/g, "&amp;")
33363336
.replace(/</g, "&lt;")
33373337
.replace(/>/g, "&gt;")
3338-
.replace(/[\\`*_[\]{}()#+.!|~-]/g, "\\$&") ||
3338+
.replace(/[\\`*_[\]{}()#+.!|~$-]/g, (character) => `&#${character.charCodeAt(0)};`) ||
33393339
(method === "select"
33403340
? "Choose an option"
33413341
: method === "editor"

0 commit comments

Comments
 (0)