[GH-ISSUE #13709] issue: Markdown block of code containing "---" #17005

Closed
opened 2026-04-19 22:47:41 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @goulvenb on GitHub (May 8, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13709

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.7

Ollama Version (if applicable)

v0.6.8

Operating System

Windows 11

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

When sending a piece of text immediately followed by a block of code starting with "---", everything should be well formatted :
Image

PS : this is applicable for, for example, YAML block of code, where "---" is widely used as the 1st line (cf. StackOverflow, RedHat)

Actual Behavior

When sending a piece of text immediately followed by a block of code starting with "---", the ``` is ignored and the text above it is transformed into a title.
The ``` used for ending the block of code are therefor used as the start of the block of code
Image

Steps to Reproduce

  1. Open a new chat or edit an already existing prompt
  2. Copy or manually write the following bloc code (if you manually type it, be wary of the "---" as they are automatically merged into "—-") :
test
```
---
```
  1. Send

Logs & Screenshots

Example n°1 :

test
```
---
```

Expected Behavior :
Image
Actual Behavior :
Image


Example n°2 :

this is a PVC for k8s :
```
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pihole-etc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
```

Expected Behavior :
Image
Actual Behavior :
Image

Additional Information

No response

Originally created by @goulvenb on GitHub (May 8, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13709 ### 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.7 ### Ollama Version (if applicable) v0.6.8 ### Operating System Windows 11 ### 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. - [ ] I have included the browser console logs. - [ ] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior When sending a piece of text immediately followed by a block of code starting with "---", everything should be well formatted : ![Image](https://github.com/user-attachments/assets/36ee53d7-8b98-4092-847a-7a0a8f4f98e4) PS : this is applicable for, for example, YAML block of code, where "---" is widely used as the 1st line (cf. [StackOverflow](https://stackoverflow.com/questions/50788277/why-3-dashes-hyphen-in-yaml-file), [RedHat](https://www.redhat.com/en/topics/automation/what-is-yaml)) ### Actual Behavior When sending a piece of text immediately followed by a block of code starting with "---", the ` ``` ` is ignored and the text above it is transformed into a title. The ` ``` ` used for ending the block of code are therefor used as the start of the block of code ![Image](https://github.com/user-attachments/assets/827c7de2-0426-4bbe-ba1b-77f038ad29cc) ### Steps to Reproduce 1. Open a new chat or edit an already existing prompt 2. Copy or manually write the following bloc code (if you manually type it, be wary of the "---" as they are automatically merged into "—-") : ```` test ``` --- ``` ```` 3. Send ### Logs & Screenshots # Example n°1 : ```` test ``` --- ``` ```` Expected Behavior : ![Image](https://github.com/user-attachments/assets/36ee53d7-8b98-4092-847a-7a0a8f4f98e4) Actual Behavior : ![Image](https://github.com/user-attachments/assets/827c7de2-0426-4bbe-ba1b-77f038ad29cc) --- # Example n°2 : ```` this is a PVC for k8s : ``` --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pihole-etc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi ``` ```` Expected Behavior : ![Image](https://github.com/user-attachments/assets/244b4d6c-93fa-4e28-8219-faece34272bd) Actual Behavior : ![Image](https://github.com/user-attachments/assets/c048a7ec-6d15-49f4-ba82-aa6efc8ec1f1) ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 22:47:41 -05:00
Author
Owner

@tjbck commented on GitHub (May 10, 2025):

This is caused by malformed markdown.

Using triple backticks to create a code block requires a new line between the previous content.

<!-- gh-comment-id:2868856876 --> @tjbck commented on GitHub (May 10, 2025): This is caused by malformed markdown. Using triple backticks to create a code block requires a new line between the previous content.
Author
Owner

@goulvenb commented on GitHub (May 10, 2025):

That seem strange, i know there are many Markdown flavors out there, but i don't remember any of them needing a new line before a block of code ?

For example, the following example do not need a new line :

And those do not specify the need of a new line (so i believe it's not mandatory, or else it would've been specified) :

What flavor is used here ?

<!-- gh-comment-id:2868891360 --> @goulvenb commented on GitHub (May 10, 2025): That seem strange, i know there are many Markdown flavors out there, but i don't remember any of them needing a new line before a block of code ? For example, the following example do not need a new line : - Example 140 of the [CommonMark specification](https://spec.commonmark.org/0.31.2/#fenced-code-blocks) - [Example 110 of the GitHub Flavored Markdown](https://github.github.com/gfm/#example-110) And those do not specify the need of a new line (so i believe it's not mandatory, or else it would've been specified) : - [Github Documentation](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code) - [GitLab Flavored Markdown](https://docs.gitlab.com/user/markdown/#code-spans-and-blocks) - 1st result of [Google](https://www.google.com/search?q=markdown%20documentation) while searching for [Markdown Documentation](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) What flavor is used here ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17005