issue: ``` copied when using the bottom "copy" of a message, when copying from a "code only" response #4878

Closed
opened 2025-11-11 16:05:30 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @darkBuddha on GitHub (Apr 17, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.5

Ollama Version (if applicable)

No response

Operating System

Debian 12

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

If a response comprises only a single code block, the "copy" button on the bottom of the message should not include the surrounding ```

Actual Behavior

Clicking on the "copy" button below a "code only" LLM response is including ```

Steps to Reproduce

  1. Tell LLM to respond with one code block only
  2. Use the "Copy" button below the message. It contains ```
  3. The "copy" button on top of the code block doesn't contain it

Logs & Screenshots

Image

Image

Image

Additional Information

No response

Originally created by @darkBuddha on GitHub (Apr 17, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.5 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 12 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior If a response comprises only a single code block, the "copy" button on the bottom of the message should not include the surrounding ``` ### Actual Behavior Clicking on the "copy" button below a "code only" LLM response is including ``` ### Steps to Reproduce 1. Tell LLM to respond with one code block only 2. Use the "Copy" button below the message. It contains ``` 3. The "copy" button on top of the code block doesn't contain it ### Logs & Screenshots ![Image](https://github.com/user-attachments/assets/3a0f4226-641e-4be2-8253-91a8143d9326) ![Image](https://github.com/user-attachments/assets/c0cfe42a-c099-4583-8828-1b762aa72ec8) ![Image](https://github.com/user-attachments/assets/89506d65-3066-4aac-810c-1e548e9be556) ### Additional Information _No response_
GiteaMirror added the bug label 2025-11-11 16:05:30 -06:00
Author
Owner

@tjbck commented on GitHub (Apr 19, 2025):

Intended behaviour.

@tjbck commented on GitHub (Apr 19, 2025): Intended behaviour.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4878