Closed jooni22 closed 2 months ago
Hi! Can you provide a sample input in text that would reproduce this issue?
can repro by setting system prompt to something like only return ```[0] ```
only happens with code elements
Let's just remove the replace logic - https://github.com/devflowinc/trieve/blob/main/frontends/chat/src/components/Atoms/AfMessage.tsx#L106-L115
Description
When square brackets are generated in the response, the Markdown render does not work properly, and render raw HTML tags.
Target(s)
The issue affects the "chat" feature.
Requirement to close
Fix
Code snippet:
The image show a jq command that processes JSON data. It checks for specific conditions related to the "type" field and constructs HTML button elements with onclick events.
Problem visualization:
On the image highlights parts of the code in red, showing where HTML tags like and
Expected behavior:
It seems the Markdown renderer should be processing these tags, but instead, they are appearing as raw text in the chat interface.
This issue appears to be related to how the chat interface handles Markdown rendering when the response contains dynamically generated HTML elements, particularly those with square brackets. The problem likely stems from conflicts between Markdown parsing and the insertion of raw HTML tags in the output.
Community channels
Matrix is preferred. Reach out on discord or Matrix for further assistance.