Fix stripHTMLFromToolInput conversion escaping (#4989)

* fix to square bracket handling

* updated comment
This commit is contained in:
russelj1 2025-08-11 12:16:18 +01:00 committed by GitHub
parent 68dc041d02
commit 114a844964
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1346,8 +1346,8 @@ export const refreshOAuth2Token = async (
export const stripHTMLFromToolInput = (input: string) => {
const turndownService = new TurndownService()
let cleanedInput = turndownService.turndown(input)
// After conversion, replace any escaped underscores with regular underscores
cleanedInput = cleanedInput.replace(/\\_/g, '_')
// After conversion, replace any escaped underscores and square brackets with regular unescaped ones
cleanedInput = cleanedInput.replace(/\\([_[\]])/g, '$1')
return cleanedInput
}