Unable to create the expected Preview of response in chat response #21838

Open
opened 2026-02-21 20:14:32 -05:00 by yindo · 1 comment
Owner

Originally created by @AvviCoder on GitHub (Jan 22, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.2

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

  1. Initate the chat with the start flow.
  2. Enter the branch code and the customer number as the inputs
  3. After selecting the desired option
  4. The output preview is coming, but not in a desired format.

Current preview -

Image

Here the output should come with multiline which i am trying to handle through
tag in the HTML button but it is not supporting the same.

✔️ Expected Behavior

The expected behavior should be mutli-line text inside the button, Here's the reference image of the expected output -

Image

Actual Behavior

The current behavior is showing all the data in a single line even after using break tags in HTML -

Image
Originally created by @AvviCoder on GitHub (Jan 22, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.2 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce 1. Initate the chat with the start flow. 2. Enter the branch code and the customer number as the inputs 3. After selecting the desired option 4. The output preview is coming, but not in a desired format. Current preview - <img width="1901" height="1062" alt="Image" src="https://github.com/user-attachments/assets/ccf43d90-5663-4fd4-9d82-c0734d38d307" /> Here the output should come with multiline which i am trying to handle through <br/> tag in the HTML button but it is not supporting the same. ### ✔️ Expected Behavior The expected behavior should be mutli-line text inside the button, Here's the reference image of the expected output - <img width="741" height="179" alt="Image" src="https://github.com/user-attachments/assets/fbc0a5b1-8d63-4f2d-99a4-f848df74fe7b" /> ### ❌ Actual Behavior The current behavior is showing all the data in a single line even after using break tags in HTML - <img width="1887" height="986" alt="Image" src="https://github.com/user-attachments/assets/d8f5c4b6-dd45-418b-b2d0-50912095400f" />
Author
Owner

@dosubot[bot] commented on GitHub (Jan 22, 2026):

Hi @AvviCoder! I'm Dosu and I’m helping the dify team.

Multiline button labels using <br/> tags aren't supported in Dify right now. The frontend renders button text as plain text, so any HTML tags like <br/> are ignored and won't create line breaks. This is intentional—HTML rendering in buttons is disabled for security reasons (to prevent XSS attacks) and to keep the UI consistent. Even though the button CSS allows text wrapping, only plain text is used, so you can't force line breaks with HTML or Markdown syntax in button labels [source 1] [source 2].

There isn't a built-in workaround for true multiline buttons. If you just want long text to wrap naturally, that should work if you remove the <br/> tags and let the button width force wrapping. If you need explicit line breaks, that's not possible without a code change to allow HTML rendering in button labels, which is currently not recommended due to security concerns.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 22, 2026): <!-- Greeting --> Hi @AvviCoder! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Multiline button labels using `<br/>` tags aren't supported in Dify right now. The frontend renders button text as plain text, so any HTML tags like `<br/>` are ignored and won't create line breaks. This is intentional—HTML rendering in buttons is disabled for security reasons (to prevent XSS attacks) and to keep the UI consistent. Even though the button CSS allows text wrapping, only plain text is used, so you can't force line breaks with HTML or Markdown syntax in button labels [[source 1]](https://github.com/langgenius/dify/blob/515002a8ba7c62f6b614793994a529dc3d8a2ffc/web/app/components/base/markdown-blocks/button.tsx#L6-L34) [[source 2]](https://github.com/langgenius/dify/issues/27544). There isn't a built-in workaround for true multiline buttons. If you just want long text to wrap naturally, that should work if you remove the `<br/>` tags and let the button width force wrapping. If you need explicit line breaks, that's not possible without a code change to allow HTML rendering in button labels, which is currently not recommended due to security concerns. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8aa5fa17-11c9-4ba0-b6da-81fc425ef914?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Multiline%20button%20labels%20using%20%60%3Cbr/%3E%60%20tags%20aren%27t%20supported%20in%20Dify%20right%20now.%20The%20frontend%20renders%20button%20text%20as%20plain%20text%2C%20so%20any%20HTML%20tags%20like%20%60%3Cbr/%3E%60%20are%20ignored%20and%20won%27t%20create%20line%20breaks.%20This%20is%20intentional%E2%80%94HTML%20rendering%20in%20buttons%20is%20disabled%20for%20security%20reasons%20%28to%20prevent%20XSS%20attacks%29%20and%20to%20keep%20the%20UI%20consistent.%20Even%20though%20the%20button%20CSS%20allows%20text%20wrapping%2C%20only%20plain%20text%20is%20used%2C%20so%20you%20can%27t%20force%20line%20breaks%20with%20HTML%20or%20Markdown%20syntax%20in%20button%20labels%20%5B%5Bsource%201%5D%5D%28https%3A//github.com/langgenius/dify/blob/515002a8ba7c62f6b614793994a529dc3d8a2ffc/web/app/components/base/markdown-blocks/button.tsx%23L6-L34%29%20%5B%5Bsource%202%5D%5D%28https%3A//github.com/langgenius/dify/issues/27544%29.%0A%0AThere%20isn%27t%20a%20built-in%20workaround%20for%20true%20multiline%20buttons.%20If%20you%20just%20want%20long%20text%20to%20wrap%20naturally%2C%20that%20should%20work%20if%20you%20remove%20the%20%60%3Cbr/%3E%60%20tags%20and%20let%20the%20button%20width%20force%20wrapping.%20If%20you%20need%20explicit%20line%20breaks%2C%20that%27s%20not%20possible%20without%20a%20code%20change%20to%20allow%20HTML%20rendering%20in%20button%20labels%2C%20which%20is%20currently%20not%20recommended%20due%20to%20security%20concerns.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31397)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21838