https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm using the Retell chat widget (embedded via Jav...
# ❓・ai-evy-support
m
@AI Evy I'm using the Retell chat widget (embedded via JavaScript) and having formatting issues with agent responses that contain structured information. PROBLEM: When my agent returns order details with line breaks (\n characters), the chat widget displays everything as one continuous paragraph with no line breaks, making it hard to read. EXAMPLE OF WHAT'S RETURNED: "Here's your order:\n\nORDER #215230 - FULFILLED\nOrder Date: 04/15/2024\n\nITEMS ORDERED:\n• 2x Snake Plant\n• 1x Potting Mix\n\nSHIPPING TO:\n123 Main St\nLancaster, PA 17601" WHAT DISPLAYS: "Here's your order: ORDER #215230 - FULFILLED Order Date: 04/15/2024 ITEMS ORDERED: • 2x Snake Plant • 1x Potting Mix SHIPPING TO: 123 Main St Lancaster, PA 17601" QUESTIONS: 1. Does the chat widget support any text formatting (Markdown, HTML, or line breaks)? 2. How should I format agent responses to display structured data readably? 3. Is there a setting or data attribute for the widget to enable proper line break rendering? 4. Should I be returning data differently from my webhook or configuring the agent differently? 5. Is white-space: pre-wrap styling applied to chat messages? I need users to be able to read multi-line order summaries, inventory lists, and tracking information clearly. What's the recommended approach?
a
Thanks for tagging me @mcnft_. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, the Retell chat widget does not support Markdown or rich-text formatting [(1) ]() . The widget renders plain text, which means line breaks (
\n
) and other formatting characters are collapsed into continuous paragraphs . Answers to your questions: 1. No, the chat widget does not support Markdown, HTML, or line break rendering . It only renders plain text . 2. Since the widget collapses formatting, you cannot display structured data with line breaks in the current implementation . The nicely formatted bullets and newlines you see in your webhook data (like in Make.com) arrive as
\n
characters, but the UI collapses them . 3. There is no documented setting or data attribute in the chat widget configuration that enables proper line break rendering [(2) ]() . 4. This is a rendering issue, not a prompt/LLM issue [(1) ]() . Even if your agent returns properly formatted data with line breaks, the widget will collapse them . 5. The sources do not mention
white-space: pre-wrap
styling being applied to chat messages [(2) ]() . Current limitation: The Retell chat widget documentation does not advertise support for Markdown or rich-text formatting [(1) ]() . Your structured order details with line breaks will display as one continuous paragraph regardless of how you format the agent's response . For displaying multi-line order summaries, inventory lists, and tracking information clearly, you may need to explore custom styling solutions or contact Retell support for potential workarounds, as the standard widget does n
ot support this formatting natively.
​ To learn more, see the sources I considered: [[1] Chatbot formatting issue](https://discord.com/channels/1186424376300679209/1410337496922984518) [[2] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.