microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.57k stars 2.43k forks source link

Code Snippet Rendering Issue: HTML Entity Conversion for Less-Than Symbol #689

Closed jegberin closed 1 week ago

jegberin commented 6 months ago

Describe the bug We have encountered a recurring issue within our web application where code snippets are not being displayed correctly. Specifically, the less-than symbol ('<') is being converted to its corresponding HTML entity ('<') when rendered on web pages, which is causing confusion and misinterpretation of the code presented to our users.

Examples of the Issue:

When displaying a C# for loop, the less-than symbol in the loop condition is being converted, resulting in incorrect display:

Expected: (int i = 0; i < 5; i++) Actual: (int i = 0; i &lt; 5; i++) image image image

To Reproduce Steps to reproduce the behavior: The issue does not occur in OAI Playground. image

Configuration: Please provide the following

MoellerAI commented 5 months ago

@iseabock this still doesn't work as intended. The code should be formatted using react-syntax-highlighter when there is a block of code, not when single symbols are mentioned, e.g. if the chatbot answers something inside `` as the example also shows in the PR. also my < sign is still renedered as raw hml inside the code blocks.

Now almost all markdown is rendered as codeblocks.

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 14 days since being marked as stale.