- Issue created by @danrod
- Merge request !555Issue #3518951: Allow rendering HTML snippets (and code from other programming... → (Open) created by annmarysruthy
- 🇮🇳India annmarysruthy
Raised an MR #2 for improving the readability of code snippets in the Chat Generation Explorer.
- 🇬🇧United Kingdom MrDaleSmith
Works well, applies cleanly. i think this is a good addition to the module. RTBC.
- 🇨🇦Canada danrod Ottawa
@mrdalesmith which AI provider did you use? I'm working with OpenAI mostly, but I'm not sure how the other AI providers deliver/encode the HTML sentences sent to the app requesting it.
- 🇮🇳India prashant.c Dharamshala
Still issues with special characters, please refer to the attachment:
Moving to NW.
- 🇮🇳India annmarysruthy
Hi @prashant.c, I was unable to replicate the issue. tried with openai(different models) and gemini.
- 🇬🇧United Kingdom MrDaleSmith
Might also be worth looking at the HTML structure of that response: it looks to me from the screenshot that the issue occurs outside of the codeblock this MR adds.
- 🇮🇳India prashant.c Dharamshala
This is, in general, like whenever we give a prompt that returns a code snippet also along with a description, for example: "Give me a sample PHP code".
Whenever the prompt returns a code snippet, it should not be displayed as a single string, and in addition to the formatting of the response should go off.
- 🇮🇳India annmarysruthy
Gave the same prompt. still not getting the issue you mentioned.
- 🇮🇳India Ishani Patel
I've checked with special characters and tried with OpenAI,
I replicated the issue, Please check the attachment.1)
2)
- First commit to issue fork.
- 🇮🇳India sarvjeetsingh
Updated #MR
Updated the processResponseText() method in ChatGenerator.php to improve code block handling.
The new implementation better distinguishes between fenced code blocks, inline code references, and HTML code blocks.
HTML tags and special characters are now handled better in description text. - 🇬🇧United Kingdom MrDaleSmith
Test fail is unrelated, but it would be good to know (away from this issue) what's happened to provoke it. Code looks good and a more robust version of the original fix. I cannot recreate the problem some users had with the first attempt, so we may need someone who can to confirm this change addresses the issue.