Nested markdown parsing bug #5461

Closed
opened 2026-02-21 18:11:04 -05:00 by yindo · 2 comments
Owner

Originally created by @jaxonister on GitHub (Sep 8, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.7.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce


# 111

```bash
npm -v

The above document will be parsed and the result will be divided into two markdown documents

### ✔️ Expected Behavior

Renders into a markdown document

### ❌ Actual Behavior

The above document will be parsed and the result will be divided into two markdown documents
Originally created by @jaxonister on GitHub (Sep 8, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ```markdown # 111 ```bash npm -v ``` ``` The above document will be parsed and the result will be divided into two markdown documents ### ✔️ Expected Behavior Renders into a markdown document ### ❌ Actual Behavior The above document will be parsed and the result will be divided into two markdown documents
yindo added the 🐞 bug label 2026-02-21 18:11:04 -05:00
yindo closed this issue 2026-02-21 18:11:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 8, 2024):

The issue you're encountering seems to be related to how Dify's markdown parser handles code blocks within markdown documents. According to the code in markdown.js, the parser identifies code blocks starting with triple backticks (```) or triple tildes (~~~) and processes them accordingly. However, it treats the content within these code blocks as plain text (variable.source), which might be causing the splitting issue you're seeing [1].

To address this, you might want to check if there are any specific configurations or updates available for the markdown parser that could resolve this behavior. If the issue persists, consider reporting it as a bug in the repository for further investigation by the maintainers.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 8, 2024): <!-- Answer --> The issue you're encountering seems to be related to how Dify's markdown parser handles code blocks within markdown documents. According to the code in `markdown.js`, the parser identifies code blocks starting with triple backticks (```) or triple tildes (~~~) and processes them accordingly. However, it treats the content within these code blocks as plain text (`variable.source`), which might be causing the splitting issue you're seeing <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/public/vs/basic-languages/markdown/markdown.js)</sup>. To address this, you might want to check if there are any specific configurations or updates available for the markdown parser that could resolve this behavior. If the issue persists, consider reporting it as a bug in the repository for further investigation by the maintainers. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Sep 9, 2024):

Well, even github can not parse it correctly in this thread.

@crazywoola commented on GitHub (Sep 9, 2024): Well, even github can not parse it correctly in this thread.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5461