[GH-ISSUE #16337] issue: Typing ``` 3 backticks followed by <shift-enter> removes backticks if "Enter Key Behavior" is "Enter to Send" #56532

Closed
opened 2026-05-05 19:39:09 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @scottrbaxter on GitHub (Aug 6, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16337

Check Existing Issues

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

Installation Method

Git Clone

Open WebUI Version

V0.6.18

Ollama Version (if applicable)

N/A

Operating System

macOS Sequoia

Browser (if applicable)

Brave Browser (1.80.125), Microsoft Edge, Safari WebApp

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

start with the cursor at any empty line in the text input dialog box

  1. press backtick key three times
  2. hold shift and press enter
  3. newline created under 3 backticks, indicating the start of a markdown code block

Actual Behavior

backticks are unintentionally removed and cursor appears at beginning of line

Steps to Reproduce

Begin with a new empty prompt

  1. start with the cursor (at any empty line) in the text input dialog box
  2. press backtick key three times
  3. hold shift and press enter
  4. newline created in place of 3 backticks, removing them unexpectedly

Logs & Screenshots

Image

pressed "shift-enter" to add a newline and the 3 backticks on the 2nd line vanish

Image

Additional Information

this bug began recently, within the last 1-2 months. 100% reproducible and occurs on multiple macs, and different browsers. I've launched 3 different open-webui deployments with unique configurations, and this occurs on all of them.

the only way to keep 3 backticks from being removed is if they are not the first characters on the line. alternatively, pasting in a block of code and then adding 3 backticks below this text, then scrolling back up to the beginning of this input text, adding a newline and finally adding 3 backticks. this band-aid works, but is very unintuitive and not user friendly. afterwords, i must move the cursor with arrow keys or add more characters before i can use shift-enter to add a newline, else they will be unintentionally removed again. (fwiw, 1, 2, 4, 5, or 6, etc. backticks will persist, but 3 will disappear).

the only solution i've found is to change Enter Key Behavior to Ctrl+Enter to Send, but this wasn't required until very recently and i would prefer to not have to change this behaviour just for ease of use with code blocks.

this seems to only affect lines that start with 3 backticks, directly followed by pressing shift-enter to add a newline. any other characters before or after will result in "shift-enter" producing a newline below the current text, as anticipated.

Originally created by @scottrbaxter on GitHub (Aug 6, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/16337 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version V0.6.18 ### Ollama Version (if applicable) N/A ### Operating System macOS Sequoia ### Browser (if applicable) Brave Browser (1.80.125), Microsoft Edge, Safari WebApp ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior start with the cursor at any empty line in the text input dialog box 1. press backtick key three times 2. hold shift and press enter 3. newline created under 3 backticks, indicating the start of a markdown code block ### Actual Behavior backticks are unintentionally removed and cursor appears at beginning of line ### Steps to Reproduce Begin with a new empty prompt 1. start with the cursor (at any empty line) in the text input dialog box 2. press backtick key three times 3. hold shift and press enter 4. newline created in place of 3 backticks, removing them unexpectedly ### Logs & Screenshots <img width="1156" height="632" alt="Image" src="https://github.com/user-attachments/assets/e0c79bc5-2ab9-464a-9573-21e57463e97e" /> pressed "shift-enter" to add a newline and the 3 backticks on the 2nd line vanish <img width="1156" height="632" alt="Image" src="https://github.com/user-attachments/assets/8eb643f8-2d08-4f9f-bb0e-91bf12945e16" /> ### Additional Information this bug began recently, within the last 1-2 months. 100% reproducible and occurs on multiple macs, and different browsers. I've launched 3 different open-webui deployments with unique configurations, and this occurs on all of them. the only way to keep 3 backticks from being removed is if they are not the first characters on the line. alternatively, pasting in a block of code and then adding 3 backticks below this text, then scrolling back up to the beginning of this input text, adding a newline and finally adding 3 backticks. this band-aid works, but is very unintuitive and not user friendly. afterwords, i must move the cursor with arrow keys or add more characters before i can use shift-enter to add a newline, else they will be unintentionally removed again. (fwiw, 1, 2, 4, 5, or 6, etc. backticks will persist, but 3 will disappear). the only solution i've found is to change `Enter Key Behavior` to `Ctrl+Enter to Send`, but this wasn't required until very recently and i would prefer to not have to change this behaviour just for ease of use with code blocks. this seems to only affect lines that start with 3 backticks, directly followed by pressing shift-enter to add a newline. any other characters before or after will result in "shift-enter" producing a newline below the current text, as anticipated.
GiteaMirror added the bug label 2026-05-05 19:39:09 -05:00
Author
Owner

@jay3ss commented on GitHub (Aug 7, 2025):

This happens to me too. The way I work around it is to type three backticks then hit the space key and it'll create the code block and put your cursor in it. If you want the syntax highlighting it works with that too, just have to type three backticks and then the language then hit space and you'll get the language's syntax highlighting in the code block

<!-- gh-comment-id:3162151325 --> @jay3ss commented on GitHub (Aug 7, 2025): This happens to me too. The way I work around it is to type three backticks then hit the space key and it'll create the code block and put your cursor in it. If you want the syntax highlighting it works with that too, just have to type three backticks and then the language then hit space and you'll get the language's syntax highlighting in the code block
Author
Owner

@humblemodulo commented on GitHub (Aug 7, 2025):

Same, very frustrating. Been happening for a while.

<!-- gh-comment-id:3162206956 --> @humblemodulo commented on GitHub (Aug 7, 2025): Same, very frustrating. Been happening for a while.
Author
Owner

@Rain6435 commented on GitHub (Aug 7, 2025):

This has been fixed as per my PR.

<!-- gh-comment-id:3162473190 --> @Rain6435 commented on GitHub (Aug 7, 2025): This has been fixed as per my PR.
Author
Owner

@scottrbaxter commented on GitHub (Aug 11, 2025):

@Rain6435 I just updated to v0.6.21 and this issue persists. It appears as though your solution was implemented already.

Could you please explain how you tested and confirmed this solution? This issue should not be closed yet, but i cannot re-open it even though i created it.

<!-- gh-comment-id:3173043244 --> @scottrbaxter commented on GitHub (Aug 11, 2025): @Rain6435 I just updated to `v0.6.21` and this issue persists. It appears as [though your solution](https://github.com/open-webui/open-webui/commit/e6726d84442ee4aeaef4ac70ff96ea1e8ac08255) was implemented already. Could you please explain how you tested and confirmed this solution? This issue should not be closed yet, but i cannot re-open it even though i created it.
Author
Owner

@humblemodulo commented on GitHub (Aug 11, 2025):

@Rain6435 I just updated to v0.6.21 and this issue persists.

@scottrbaxter It persisted for me as well until I cleared browser cache. Now it enters a sort of "markdown mode" (rather than simply leaving plain backticks) when you cmd/ctrl + enter.

<!-- gh-comment-id:3173048223 --> @humblemodulo commented on GitHub (Aug 11, 2025): > [@Rain6435](https://github.com/Rain6435) I just updated to `v0.6.21` and this issue persists. @scottrbaxter It persisted for me as well until I cleared browser cache. Now it enters a sort of "markdown mode" (rather than simply leaving plain backticks) when you `cmd/ctrl + enter`.
Author
Owner

@Rain6435 commented on GitHub (Aug 11, 2025):

@scottrbaxter please understand that m'y solution wasn't integrated by @tjbck . Please address him regarding this matter.
In my opinion, the solution of @tjbck is pretty rudimentary and exclusively covers the issue but not all edge cases. If you would like to checkout to my branch and tell me if you still see the issue, I would be interested in seeing what you get because I thoroughly tested it.

<!-- gh-comment-id:3173050632 --> @Rain6435 commented on GitHub (Aug 11, 2025): @scottrbaxter please understand that m'y solution wasn't integrated by @tjbck . Please address him regarding this matter. In my opinion, the solution of @tjbck is pretty rudimentary and exclusively covers the issue but not all edge cases. If you would like to checkout to my branch and tell me if you still see the issue, I would be interested in seeing what you get because I thoroughly tested it.
Author
Owner

@scottrbaxter commented on GitHub (Aug 11, 2025):

@humblemodulo I see, tested with another browser and i do also notice the "markdown mode" code block bubble... however, that only happens with three backticks alone on a line. now i can't ever include a language specific code block, e.g. "three backticks" followed by "python" on the line... if i add any character other than a 4th backtick, the line gets cleared, which is actually the opposite of the original issue i submitted, however, still causes an issue directly related to markdown syntax highlighting.

@Rain6435 my mistake, thanks for clarity.

@tjbck this change modifies but does not fix the original issue. Is this auto "markdown mode" code block bubble supposed to forcibly pop up in this use case? If so, that will potentially cause pasting issues, which will either require manual edits or incorrectly formatted markdown preview upon submission. Perhaps I'm misunderstanding what "manually" means in this statement.

✏️ Manual Code Block Creation in Chat Restored: Fixed an issue where typing three backticks and then pressing Shift+Enter would incorrectly remove the backticks when "Enter to Send" mode was active. This ensures users can reliably create multi-line code blocks manually.

Entering this "markdown mode" thing is not manual, since it's automatically formatting my text input for a visual interpretation. Is there a way that users can toggle the ui visual manipulation off, so we can explicitly guarantee clear formatting when markdown is submitted? I often struggle with output request/prompt that gets returned is visually not formatted as expected (would absolutely love a markdown "preview" button similar to github comments 🙃). my fix has been to stop the model from proceeding, edit the prompt, fix the incorrectly formatted text, and re-run. it's not obvious when this will happen and sadly, it's not easy to 100% reproduce, which is why i've not submitted a formal github issue for it, yet. If i don't do this, then the incorrectly formatted prompt remains in history this way, which is not ideal. It's also wasteful, and potentially costly, having to redo prompts over time. If users are able to disable the auto-visual changes before submitting the user prompt (but i'd still like to see the correctly formatted markdown on submission), this would be ideal for a general "manual" markdown creation... (similar to Slack, i suppose). tbh, it doesn't need to be limited to multi-line code blocks, but i'd be happy to see that if that's an easier solution.

Could this issue please be re-opened until there's a complete solution?

<!-- gh-comment-id:3173186520 --> @scottrbaxter commented on GitHub (Aug 11, 2025): @humblemodulo I see, tested with another browser and i do also notice the "markdown mode" code block _bubble_... however, that only happens with three backticks alone on a line. now i can't ever include a language specific code block, e.g. "three backticks" followed by "python" on the line... if i add any character other than a 4th backtick, the line gets cleared, which is actually the opposite of the original issue i submitted, however, still causes an issue directly related to [markdown syntax highlighting](https://www.markdownguide.org/extended-syntax/#syntax-highlighting). @Rain6435 my mistake, thanks for clarity. @tjbck [this](https://github.com/open-webui/open-webui/commit/e6726d84442ee4aeaef4ac70ff96ea1e8ac08255) change modifies but does not fix the original issue. Is this auto "markdown mode" code block bubble supposed to forcibly pop up in this use case? If so, that will potentially cause pasting issues, which will either require manual edits or incorrectly formatted markdown preview upon submission. Perhaps I'm misunderstanding what "manually" means in this statement. > ✏️ Manual Code Block Creation in Chat Restored: Fixed an issue where typing three backticks and then pressing Shift+Enter would incorrectly remove the backticks when "Enter to Send" mode was active. This ensures users can reliably create multi-line code blocks manually. Entering this "markdown mode" thing is not _manual_, since it's automatically formatting my text input for a visual interpretation. Is there a way that users can toggle the ui visual manipulation off, so we can explicitly guarantee clear formatting when markdown is submitted? I often struggle with output request/prompt that gets returned is visually not formatted as expected (would absolutely love a markdown "preview" button similar to github comments 🙃). my _fix_ has been to stop the model from proceeding, edit the prompt, fix the incorrectly formatted text, and re-run. it's not obvious when this will happen and sadly, it's not easy to 100% reproduce, which is why i've not submitted a formal github issue for it, yet. If i don't do this, then the incorrectly formatted prompt remains in history this way, which is not ideal. It's also wasteful, and potentially costly, having to redo prompts over time. If users are able to disable the auto-visual changes _before_ submitting the user prompt (but i'd still like to see the correctly formatted markdown on submission), this would be ideal for a general "manual" markdown creation... (similar to Slack, i suppose). tbh, it doesn't need to be limited to multi-line code blocks, but i'd be happy to see that if that's an easier solution. Could this issue please be re-opened until there's a complete solution?
Author
Owner

@scottrbaxter commented on GitHub (Aug 31, 2025):

It seems this is not going to get further attention unless a new issue is created. for anyone stumbling upon this issue and would like an alternative, there a user option under Settings / UI to simply toggle Rich Text Input for Chat off, so that no rich text/markdown will not be generated until submitting the query. Where not a direct replacement, at least this issue doesn't have a chance to occur... might save a lot of retyping.

<!-- gh-comment-id:3240316865 --> @scottrbaxter commented on GitHub (Aug 31, 2025): It seems this is not going to get further attention unless a new issue is created. for anyone stumbling upon this issue and would like an alternative, there a user option under `Settings / UI` to simply toggle `Rich Text Input for Chat` _off_, so that no rich text/markdown will not be generated until submitting the query. Where not a direct replacement, at least this issue doesn't have a chance to occur... might save a lot of retyping.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#56532