[GH-ISSUE #1359] [BUG]: Copy response omits some content #859

Closed
opened 2026-02-22 18:21:50 -05:00 by yindo · 4 comments
Owner

Originally created by @frost19k on GitHub (May 11, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1359

How are you running AnythingLLM?

Docker (local)

What happened?

If a model's response contains more than one code block, the code within the second block onwards does not get copied to the clipboard - when clicking the cope response button at the bottom. You have to manually copy the code with the copy code function of said block.

Are there known steps to reproduce?

Get the model to produce a response with more than one code block. Try "Generate a simple python flask app as well as an html landing page as a demonstration"

Click the copy response button to copy the whole response text.

Paste into a text editor and observe.

Originally created by @frost19k on GitHub (May 11, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1359 ### How are you running AnythingLLM? Docker (local) ### What happened? If a model's response contains more than one code block, the code within the second block onwards does not get copied to the clipboard - when clicking the cope response button at the bottom. You have to manually copy the code with the copy code function of said block. ### Are there known steps to reproduce? Get the model to produce a response with more than one code block. Try `"Generate a simple python flask app as well as an html landing page as a demonstration"` Click the copy response button to copy the whole response text. Paste into a text editor and observe.
yindo added the possible bugcore-team-only labels 2026-02-22 18:21:50 -05:00
yindo closed this issue 2026-02-22 18:21:50 -05:00
Author
Owner

@frost19k commented on GitHub (May 11, 2024):

Screenshot from 2024-05-11 15-23-17

Screenshot from 2024-05-11 15-23-21

@frost19k commented on GitHub (May 11, 2024): ![Screenshot from 2024-05-11 15-23-17](https://github.com/Mintplex-Labs/anything-llm/assets/49780407/7eb53031-ec36-49d8-bc0d-f6a7a775b56d) ![Screenshot from 2024-05-11 15-23-21](https://github.com/Mintplex-Labs/anything-llm/assets/49780407/fea3e17d-5274-48ba-8ec0-54ac518aa56f)
Author
Owner

@timothycarambat commented on GitHub (May 11, 2024):

This would appear intentional and is working as expected. If you want to copy just the code block. You would click copy on the Copy code. Copy response via the clipboard on the bottom is supposed to copy the whole response - it would be counterintuitive to selectively copy random blocks from the response.

Our app and most use cases can and will produce answers that are more than just code snippets, so it makes sense to always copy the full text if you want to copy the response.

Will close as this is intentional, however, if i am misreading the issues please continue to comment

@timothycarambat commented on GitHub (May 11, 2024): This would appear intentional and is working as expected. If you want to copy _just_ the code block. You would click copy on the `Copy code`. Copy response via the clipboard on the bottom is **supposed** to copy the whole response - it would be counterintuitive to selectively copy random blocks from the response. Our app and most use cases can and will produce answers that are more than just code snippets, so it makes sense to always copy the full text if you want to copy the response. Will close as this is intentional, however, if i am misreading the issues please continue to comment
Author
Owner

@frost19k commented on GitHub (May 11, 2024):

it would be counterintuitive to selectively copy random blocks from the response.

I agree. My point is that it's not doing that. In the screenshots you will see that html pasted into VSCode is missing several lines. It seems to be specific to HTML code blocks. I'm not seeing missing lines in code blocks labels anything else.

@frost19k commented on GitHub (May 11, 2024): > it would be counterintuitive to selectively copy random blocks from the response. I agree. My point is that it's not doing that. In the screenshots you will see that `html` pasted into VSCode is missing several lines. It seems to be specific to HTML code blocks. I'm not seeing missing lines in code blocks labels anything else.
Author
Owner

@timothycarambat commented on GitHub (May 11, 2024):

Ah, I see why this is, it was because we sanitize and strip out the HTML tags for the HTML block because of the potential of self-XSS on accident.

@timothycarambat commented on GitHub (May 11, 2024): Ah, I see why this is, it was because we sanitize and strip out the HTML tags for the HTML block because of the potential of self-XSS on accident.
yindo changed title from [BUG]: Copy response omits some content to [GH-ISSUE #1359] [BUG]: Copy response omits some content 2026-06-05 14:37:36 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#859