issue: [Chat] (initial message only) Code pasted in codeblocks immediately converted to wrong characters (see video) #4465

Closed
opened 2025-11-11 15:54:49 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @TFWol on GitHub (Mar 17, 2025).

It's been doing this for as long as I can remember. Maybe ever since the introduction of rich input.

https://github.com/user-attachments/assets/5ad2e96a-9e61-465b-8d6a-bd1949b89215

ex:
Copy and paste this into chat (include the triple backticks):

```
// ==UserScript==
// @name         blah
// @namespace    blahblah
// @version      1.0
// @author       blah
// @match        https://*
// @grant        none
// @license      MIT
// ==/UserScript==
```

You will see the code becomes:

```
// UserScript
// @name         blah
// @namespace    blahblah
// @version      1.0
// @author       blah
// @match        https://*
// @grant        none
// @license      MIT
// /UserScript
```

Another Example

When it does not get stripped

  1. Copy this (click Copy button):
foo==
==bar==
  1. Paste into Chat as is.
  2. The text is fine

When it gets stripped

  1. Copy this (click Copy button):
```
foo==
==bar==
```
  1. Paste into Chat as is.
  2. The == around bar gets stripped and you end up with:
```
foo==
bar
```

Originally posted by @TFWol in https://github.com/open-webui/open-webui/discussions/11161

Originally created by @TFWol on GitHub (Mar 17, 2025). It's been doing this for as long as I can remember. Maybe ever since the introduction of rich input. https://github.com/user-attachments/assets/5ad2e96a-9e61-465b-8d6a-bd1949b89215 ex: Copy and paste this into chat (include the triple backticks): ```` ``` // ==UserScript== // @name blah // @namespace blahblah // @version 1.0 // @author blah // @match https://* // @grant none // @license MIT // ==/UserScript== ``` ```` You will see the code becomes: ```` ``` // UserScript // @name blah // @namespace blahblah // @version 1.0 // @author blah // @match https://* // @grant none // @license MIT // /UserScript ``` ```` # Another Example ## When it **does not** get stripped 1. Copy this (click Copy button): ``` foo== ==bar== ``` 2. Paste into Chat as is. 3. The text is fine ## When it gets stripped 1. Copy this (click Copy button): ```` ``` foo== ==bar== ``` ```` 3. Paste into Chat as is. 4. The `==` around `bar` gets stripped and you end up with: ```` ``` foo== bar ``` ```` _Originally posted by @TFWol in https://github.com/open-webui/open-webui/discussions/11161_
Author
Owner

@TFWol commented on GitHub (Mar 17, 2025):

Also, words surrounded by * get converted to _.
Ex:
*broken* becomes _broken_

@TFWol commented on GitHub (Mar 17, 2025): Also, words surrounded by `*` get converted to `_`. Ex: `*broken*` becomes `_broken_`
Author
Owner

@tjbck commented on GitHub (Mar 18, 2025):

You can turn off rich text input, please check for existing discussions before creating a new issue.

@tjbck commented on GitHub (Mar 18, 2025): You can turn off rich text input, please check for existing discussions before creating a new issue.
Author
Owner

@TFWol commented on GitHub (Mar 18, 2025):

You can turn off rich text input, please check for existing discussions before creating a new issue.

Right, but that doesn't fix the core problem of rich input being messed up, hence the Issue.

I do see your point about the other existing issue though.

Duplicate of #6973

@TFWol commented on GitHub (Mar 18, 2025): > You can turn off rich text input, please check for existing discussions before creating a new issue. Right, but that doesn't fix the core problem of rich input being messed up, hence the Issue. I do see your point about the other existing issue though. Duplicate of #6973
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4465