enh: unsanitisation #1594

Closed
opened 2025-11-11 14:48:00 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @savant-martins on GitHub (Jul 24, 2024).

When code is output by a model in plain chat text rather than in a code block common character entity references are not decoded
For example "& lt;" to "<"

Steps to Reproduce:
Prompts requesting coding advice sometimes include code references in plain chat text rather than a defined code block.
In my case these are questions regarding C# where angle brackets surround type parameters, List for example

in this case the prompt was submitted against gpt-4o

Expected Behavior:
Text should be output as :

DispatcherService.Invoke(() =>
        HeldComponentViewModelItems = new ObservableCollection<HeldComponentViewModelItem>(treeNodes));

Actual Behavior:
Text is output as :

DispatcherService.Invoke(() =&gt;
        HeldComponentViewModelItems = new ObservableCollection&lt;HeldComponentViewModelItem&gt;(treeNodes));

Environment

  • Open WebUI Version:
    v0.3.10

  • Operating System:
    Windows 11

  • Browser (if applicable):
    Chrome v126.0.6478.183

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.

Logs and Screenshots

Screenshots
image

Originally created by @savant-martins on GitHub (Jul 24, 2024). When code is output by a model in plain chat text rather than in a code block common character entity references are not decoded For example "& lt;" to "<" **Steps to Reproduce:** Prompts requesting coding advice sometimes include code references in plain chat text rather than a defined code block. In my case these are questions regarding C# where angle brackets surround type parameters, List<T> for example in this case the prompt was submitted against gpt-4o **Expected Behavior:** Text should be output as : ``` DispatcherService.Invoke(() => HeldComponentViewModelItems = new ObservableCollection<HeldComponentViewModelItem>(treeNodes)); ``` **Actual Behavior:** Text is output as : ``` DispatcherService.Invoke(() =&gt; HeldComponentViewModelItems = new ObservableCollection&lt;HeldComponentViewModelItem&gt;(treeNodes)); ``` ## Environment - **Open WebUI Version:** v0.3.10 - **Operating System:** Windows 11 - **Browser (if applicable):** Chrome v126.0.6478.183 **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. ## Logs and Screenshots **Screenshots** ![image](https://github.com/user-attachments/assets/f0319d3c-e794-4f8a-a553-9ee5e2397e41)
GiteaMirror added the enhancementgood first issuehelp wanted labels 2025-11-11 14:48:00 -06:00
Author
Owner

@tjbck commented on GitHub (Jul 27, 2024):

PR Welcome!

@tjbck commented on GitHub (Jul 27, 2024): PR Welcome!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1594