Skip to content

Commit 114a844

Browse files
authored
Fix stripHTMLFromToolInput conversion escaping (#4989)
* fix to square bracket handling * updated comment
1 parent 68dc041 commit 114a844

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/components/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,8 @@ export const refreshOAuth2Token = async (
13461346
export const stripHTMLFromToolInput = (input: string) => {
13471347
const turndownService = new TurndownService()
13481348
let cleanedInput = turndownService.turndown(input)
1349-
// After conversion, replace any escaped underscores with regular underscores
1350-
cleanedInput = cleanedInput.replace(/\\_/g, '_')
1349+
// After conversion, replace any escaped underscores and square brackets with regular unescaped ones
1350+
cleanedInput = cleanedInput.replace(/\\([_[\]])/g, '$1')
13511351
return cleanedInput
13521352
}
13531353

0 commit comments

Comments
 (0)