[PR #2798] Refactor Markdown component to include paragraph after image #23845

Closed
opened 2026-02-21 20:21:52 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/2798

State: closed
Merged: Yes


Description

When the return result of the model is in the following image-plus-text format, the text following the image is not rendered:

![text](url)
Description of the image

Fixes # (issue)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  1. Create an Agent Assistant (gpt-4-0125-preview) that includes Google tools, using the following Instruction:

When a user needs you to search for an image, you perform a search using Google and then use the first URL (and only the first) result to answer the question.
Your response must be in this format:

![text](url)
Description of the image source
  1. Send "search "Image of Elon Musk"
  2. Display the image followed by a text description

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/2798 **State:** closed **Merged:** Yes --- # Description When the return result of the model is in the following image-plus-text format, the text following the image is not rendered: ``` ![text](url) Description of the image ``` Fixes # (issue) ## Type of Change - [x] Bug fix (non-breaking change which fixes an issue) # How Has This Been Tested? 1. Create an Agent Assistant (gpt-4-0125-preview) that includes Google tools, using the following Instruction: > When a user needs you to search for an image, you perform a search using Google and then use the first URL (and only the first) result to answer the question. > Your response must be in this format: > ```markdown > ![text](url) > Description of the image source > ``` 2. Send "search "Image of Elon Musk" 3. Display the image followed by a text description # Suggested Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation - [ ] `optional` I have added tests that prove my fix is effective or that my feature works - [ ] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:21:52 -05:00
yindo closed this issue 2026-02-21 20:21:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#23845