Markdown Rendering
Message content rendering in Web Chat: how Markdown headings, lists, tables, code blocks, and links appear in the chat window, the optimizations, and administrator settings.
This article introduces the message content rendering optimizations in the Web Chat window, which make Agent responses clearer and easier to read.
What Is Message Content Rendering?
Message content rendering refers to how Web Chat converts an Agent's text response into the visual presentation that users see. An Agent's response may include:
Plain text: General text descriptions
Markdown formatting: Headings, lists, bold, italics, and other formatting
Code blocks: Code examples or commands
Tables: Structured data presentation
Links: External links or reference materials
Good rendering makes this content easier to read and understand.
Optimization Items
1. Fully Upgraded Markdown Rendering Engine
Web Chat now uses an enhanced Markdown rendering engine that supports richer formatting and more precise rendering.
Supported Markdown Formats
Headings
# Heading 1, ## Heading 2
Clear heading hierarchy for dividing content into sections
Bold
**bold text**
Emphasizes key content
Italic
*italic text*
Secondary emphasis or supplementary notes
Lists
- Item 1, 1. Item 1
Ordered or unordered lists
Inline code
`code`
Inline code or commands
Code blocks
```code```
Multi-line code with syntax highlighting support
Tables
| Column 1 | Column 2 |
Structured data display
Links
[link text](URL)
Clickable hyperlinks
Blockquotes
> quote content
Quotations or special notes
Images
, {width=200px}
Displays an image; a {…} placed right after the URL sets the display size. See Adjusting Image Display Size
Link and File Link Behavior
Links in responses always open in a new tab, so users don't leave the current conversation (the only exception is in-page anchors
#…).When a link points to a PDF or another file, the browser decides how it opens: Chrome, Edge, and Safari open PDFs in a new tab with the built-in viewer, and URLs with a page number such as
https://example.com/manual.pdf#page=12jump straight to that page; if the browser is set to download PDFs, the file is downloaded instead. Web Chat does not rewrite the URL or force a download.To have the Agent reply with a "text link plus page number" instead of an attachment: put the document URL (including the page number) in the
urlmetadata of the knowledge base document or in the FAQ answer, and instruct the Agent in its role instructions to reply with Markdown links. See Custom URL Mapping. Downloading cited documents from the sources is a separate mechanism, controlled by "Allow downloading cited documents" in Function Settings.
Adjusting Image Display Size
Markdown images in Agent responses are displayed at their original size by default, up to the width of the message column. Add {width=…} or {height=…} immediately after the closing parenthesis of the image URL to set the display size of that image. Both Web Chat and the back-office conversation view (for example, when you click Start Conversation from the Agent Marketplace) support this.
For example, a customer service manager at an e-commerce company noticed that when the Agent replied with product images, a single image filled the entire chat window and customers had to keep scrolling to see the text. She added an instruction to the Agent's role instructions to always output product images in the format {width=200px} (for where to enter this, see Add Role Instructions to an Agent). After that, product images shown to customers in Web Chat on the company website have a fixed width of 200px, and colleagues chatting with the same Agent in the back office see the same size.
Available settings
Only width and height, always lowercase, each at most once, in any order
Units
px or %; the value must be greater than 0 and may include decimals (for example, 33.5%); % cannot exceed 100
Basis for percentages
% is calculated against the width of the message column
Setting both width and height
Separate the two settings with a space ({width=300px height=200px}), not a comma
Setting only one
The other dimension is adjusted automatically to keep the original aspect ratio
Position
{ must immediately follow the ) of the URL, with no space in between
Exceeding the message column width
The image is automatically scaled down to fit within the message column without distortion

{width=200px} (bottom)
2. Dark Mode Visual Optimization
When an end user's device uses a dark theme, Web Chat automatically adjusts the visual presentation of message content to ensure clarity and readability on dark backgrounds.
Dark Mode Adjustments
Text and background contrast: Automatically adjusts text color for clear display on dark backgrounds
Message feedback buttons: Adjusts button colors and borders so they remain clear in dark mode
Table visuals: Adjusts table borders and background colors for improved readability
Blockquote backgrounds: Adjusts blockquote background tones to set them apart from the main content
3. Streaming Rendering Performance Improvements
Web Chat displays Agent responses through real-time streaming, so users don't need to wait for the complete response to be generated. This update optimizes streaming rendering performance:
Faster rendering: Markdown formatting renders more quickly, reducing perceived latency
Improved smoothness: Text appears character by character more smoothly, with no noticeable lag
Format accuracy: Markdown formatting renders correctly even during streaming
Practical Use Cases
💻 Technical Documentation Assistant
Scenario: When developers ask for code examples, the Agent provides responses that include code blocks.
Optimization Effects:
Code blocks support syntax highlighting for easier reading
Code displays clearly in dark mode
Developers can copy and use the code directly
Example Response:
This code reads a CSV file and displays the first 5 rows.
Here are the top three selling products this quarter:
Product A
1,250
$125,000
Product B
980
$98,000
Product C
856
$85,600
Sales data is as of the 20th of this month.
Recommended Steps for Learning Python
Basic Syntax
Variables and data types
Conditionals and loops
Advanced Concepts
Functions and modules
Object-oriented programming
Hands-on Practice
Complete small projects
Contribute to open source
We recommend spending 2-3 weeks on each step.
Last updated
Was this helpful?