Escaping Error in code blocks: Single Backslash Duplicated in Output #1758

Closed
opened 2025-11-11 14:52:04 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @dinoamino on GitHub (Aug 13, 2024).

Bug Report

Installation Method

Docker (docker compose)

Environment

  • Open WebUI Version: v0.3.12

  • Ollama (if applicable): 0.3.4

  • Operating System: Ubuntu 22.04

  • Browser (if applicable): Firefox

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.
  • [ x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Single backslashes are not escaped in code blocks.

Actual Behavior:

Single backslashes are printed with double backslash in code blocks.

Description

Bug Summary:

Anytime a model responds with a single backslash in a code block it is displayed with a double backslash.

Reproduction Details

Steps to Reproduce:

Use a prompt on any model that would output a code block with a backslash, such as

"How do you display a literal backslash in Markdown?"

The output in Open WebUI contains double backslashes in code blocks.

Logs and Screenshots

Screenshots/Screen Recordings (if applicable):

Screenshot Markdown Backslashes

Additional Information

Running the same prompt via ollama run on any model does not duplicate the backslashes

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @dinoamino on GitHub (Aug 13, 2024). # Bug Report ## Installation Method Docker (docker compose) ## Environment - **Open WebUI Version:** v0.3.12 - **Ollama (if applicable):** 0.3.4 - **Operating System:** Ubuntu 22.04 - **Browser (if applicable):** Firefox **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. - [ x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Single backslashes are not escaped in code blocks. ## Actual Behavior: Single backslashes are printed with double backslash in code blocks. ## Description **Bug Summary:** Anytime a model responds with a single backslash in a code block it is displayed with a double backslash. ## Reproduction Details **Steps to Reproduce:** Use a prompt on any model that would output a code block with a backslash, such as > "How do you display a literal backslash in Markdown?" The output in Open WebUI contains double backslashes in code blocks. ## Logs and Screenshots **Screenshots/Screen Recordings (if applicable):** ![Screenshot Markdown Backslashes](https://github.com/user-attachments/assets/b3b19fd9-0cfd-46a8-a503-741a384bd061) ## Additional Information Running the same prompt via `ollama run` on any model does not duplicate the backslashes ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Author
Owner

@zhiqing0205 commented on GitHub (Aug 13, 2024):

Single slash becomes double slash causing error

@zhiqing0205 commented on GitHub (Aug 13, 2024): Single slash becomes double slash causing error
Author
Owner

@tjbck commented on GitHub (Aug 13, 2024):

Fixed in dev.

@tjbck commented on GitHub (Aug 13, 2024): Fixed in dev.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#1758