markdown output doesnot support to display link of image #8558

Closed
opened 2026-02-21 18:26:19 -05:00 by yindo · 5 comments
Owner

Originally created by @Modas-Li on GitHub (Feb 24, 2025).

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

V0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Modas-Li on GitHub (Feb 24, 2025). ### 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 V0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/8f3a44b8-f2a2-4682-aeef-f6ab1acd2514) ![Image](https://github.com/user-attachments/assets/d06ea15a-5fa1-4528-ad2c-e6405ef1a1ee) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:26:19 -05:00
yindo closed this issue 2026-02-21 18:26:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 24, 2025):

There is a known issue in Dify regarding the handling of Markdown image links. Specifically, there was a problem where the transform() function incorrectly processed documents starting with an image by removing the leading '![' symbols, which resulted in malformed output. To address this, the regular expression pattern in dify/api/core/tools/utils/text_processing_utils.py needs to be modified to:

pattern = r"^(?!\[image\])([!\u2000-\u206F\u2E00-\u2E7F\u3000-\u303F\"#$%&'()*+,\-./:;<=>?@\[\]^_`{|}~]+)"

This change ensures that the '![' symbols are not removed when they are part of an image markdown syntax at the start of a document [1].

Additionally, there is a similar unsolved discussion regarding the format for displaying images in Dify output, which might be relevant to your issue. You can find it here [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Feb 24, 2025): <!-- Answer --> There is a known issue in Dify regarding the handling of Markdown image links. Specifically, there was a problem where the `transform()` function incorrectly processed documents starting with an image by removing the leading '![' symbols, which resulted in malformed output. To address this, the regular expression pattern in `dify/api/core/tools/utils/text_processing_utils.py` needs to be modified to: ```python pattern = r"^(?!\[image\])([!\u2000-\u206F\u2E00-\u2E7F\u3000-\u303F\"#$%&'()*+,\-./:;<=>?@\[\]^_`{|}~]+)" ``` This change ensures that the '![' symbols are not removed when they are part of an image markdown syntax at the start of a document <sup>[[1]](https://github.com/langgenius/dify/issues/11791)</sup>. Additionally, there is a similar unsolved discussion regarding the format for displaying images in Dify output, which might be relevant to your issue. You can find it [here](https://github.com/langgenius/dify/discussions/14099) <sup>[[2]](https://github.com/langgenius/dify/discussions/14099)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3a1a13b0-717b-461a-bafa-1bc9bb258905?feedback_type=other)</sup>
Author
Owner
@crazywoola commented on GitHub (Feb 24, 2025): https://github.com/langgenius/dify/blob/403e2d58b96794727789609e41505c33374f9079/docker/.env.example#L928-L929
Author
Owner

@Modas-Li commented on GitHub (Feb 24, 2025):

dify/docker/.env.example

Lines 928 to 929 in 403e2d5

CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

CSP_WHITELIST=

how to fill in more than one address, what is the format

@Modas-Li commented on GitHub (Feb 24, 2025): > [dify/docker/.env.example](https://github.com/langgenius/dify/blob/403e2d58b96794727789609e41505c33374f9079/docker/.env.example#L928-L929) > > Lines 928 to 929 in [403e2d5](/langgenius/dify/commit/403e2d58b96794727789609e41505c33374f9079) > > # CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP > CSP_WHITELIST= how to fill in more than one address, what is the format
Author
Owner

@crazywoola commented on GitHub (Feb 24, 2025):

See the docs link above, we have already give the instruction link.

@crazywoola commented on GitHub (Feb 24, 2025): See the docs link above, we have already give the instruction link.
Author
Owner

@Modas-Li commented on GitHub (Feb 24, 2025):

See the docs link above, we have already give the instruction link.

i use blank to seperate urls, but image still cannot display, please help

@Modas-Li commented on GitHub (Feb 24, 2025): > See the docs link above, we have already give the instruction link. i use blank to seperate urls, but image still cannot display, please help
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8558