Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI message: do not render html when it's in a code block #2205

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

jurgenwerk
Copy link
Contributor

@jurgenwerk jurgenwerk commented Feb 25, 2025

The problem happens when the bot is streaming code:

image

Here is how it looks after the change in this PR:
image

It turns out the browser will render HTML tags, such as <h1>, or <template>, even when they are placed inside <pre><code> ... </code></pre>. So we need to escape these tags in order to show the actual code (and not render it as html).

Copy link

github-actions bot commented Feb 25, 2025

Host Test Results

    1 files  ±0      1 suites  ±0   23m 45s ⏱️ +7s
776 tests +1  774 ✔️ +1  2 💤 ±0  0 ±0 
781 runs  +1  779 ✔️ +1  2 💤 ±0  0 ±0 

Results for commit ab8a4b7. ± Comparison against base commit 88e77dd.

♻️ This comment has been updated with latest results.

@jurgenwerk
Copy link
Contributor Author

Just FYI, once the code is finished streaming, it changes into monaco editors:

image

@jurgenwerk jurgenwerk marked this pull request as ready for review February 25, 2025 16:50
@jurgenwerk jurgenwerk requested a review from a team February 25, 2025 16:50
@jurgenwerk jurgenwerk changed the title AI message: do not render html tags when they are inside <pre> AI message: do not render html when it's in a code block Feb 25, 2025
@jurgenwerk jurgenwerk merged commit 55fcc48 into main Feb 25, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants