https://discord.gg/botpress logo
Issue with underscore in links rendered
# 🤝help
h
Hi everyone, I'm running into a strange issue with links sent via the Botpress webchat. When I send a link like this: https://.....lhome.sto?DB_NAME=n200.... …it appears correctly in the chat. However, when users click on it, the resulting URL in the new tab becomes: https://......lhome.sto?DB%5F_NAME=n200.... Note that DB_NAME has become DB__NAME (with two underscores instead of one). This breaks the link. Has anyone else experienced this? Could this be an encoding or sanitization issue in the webchat component? Any ideas or workarounds would be appreciated! Thanks in advance!
p
I'm not experiencing the same issue. Are you using an autonomous node? If so, are you able to find a way to make a separate workflow with standard nodes, they are usually more predictable with their output?
h
@prehistoric-airplane-85682 Actually, they are standard nodes, just regular links added to the knowledge. Can I privately send you a single-node bot to show you the error?
p
You should send me your report_id in this thread instead. It only allows botpress employees to import your bot.
h
Ok, I opened a bug report and this is the report_id: report_01JVA25538H73TB6TX6M2A07GN. Thanks
p
I'll look into it. :))
This is the answer it gave me after modifying the answer variable: https://cloud.urbi.it/urbi/progs/urp/solhome.sto?DB_5FNAME=n200385b&areaAttiva=1 but this is what is on the website though: ATTENZIONE Errore Generale:: impossibile procedere
h
Yes because the original link in the knowledge: https://cloud.urbi.it/urbi/progs/urp/solhome.sto?DB_NAME=n200385b&areaAttiva=1 is probably sanitized when sent in the chat and becomes an unusable link (_ becomes %5f)
p
I think you should add intermediary steps between asking the user for their question and when the response is returned. For example you could add a query kb card and an execute code card. You would therefore be using the knowledge agent to return the link and pass it through the execute code card to clean it up before it is returned. By clean it up I mean replacing the %5f by an underscore again.
h
Thank you for the suggestion. However, I believe that even if I insert an intermediate script (e.g., via an Execute Code card), the links are sanitized before they reach that stage — meaning they are already encoded by the time the script processes them. So replacing %5F with an underscore in the code might not resolve the issue. Additionally, this would be very difficult to scale, as we have many different links spread across multiple Knowledge base articles, making it unmanageable to apply a custom fix for each one. Ideally, the webchat should preserve the original URL formatting from the Knowledge source, especially for characters like underscores that are valid in URLs and don’t normally need encoding.
3 Views