Fix stripHTMLFromToolInput conversion escaping (#4989)
* fix to square bracket handling * updated comment
This commit is contained in:
parent
68dc041d02
commit
114a844964
|
|
@ -1346,8 +1346,8 @@ export const refreshOAuth2Token = async (
|
||||||
export const stripHTMLFromToolInput = (input: string) => {
|
export const stripHTMLFromToolInput = (input: string) => {
|
||||||
const turndownService = new TurndownService()
|
const turndownService = new TurndownService()
|
||||||
let cleanedInput = turndownService.turndown(input)
|
let cleanedInput = turndownService.turndown(input)
|
||||||
// After conversion, replace any escaped underscores with regular underscores
|
// After conversion, replace any escaped underscores and square brackets with regular unescaped ones
|
||||||
cleanedInput = cleanedInput.replace(/\\_/g, '_')
|
cleanedInput = cleanedInput.replace(/\\([_[\]])/g, '$1')
|
||||||
return cleanedInput
|
return cleanedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue