For the complete documentation index, see llms.txt. This page is also available as Markdown.

Markdown Rendering

This article introduces the message content rendering optimization features in the WebChat window, making AI Assistant responses clearer and easier to read.

What Is Message Content Rendering?

Message content rendering refers to how WebChat converts the AI Assistant's text responses into the visual presentation that users see. AI Assistant responses may include:

  • Plain text: General text descriptions

  • Markdown formatting: Headers, 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

WebChat now uses an enhanced Markdown rendering engine that supports richer formatting and more precise rendering.

Supported Markdown Formats

Format Type
Syntax Example
Rendering Description

Headers

# Heading 1, ## Heading 2

Clear heading hierarchy for content segmentation

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

2. Dark Mode Visual Optimization

When end users' devices use a dark theme, WebChat automatically adjusts the visual presentation of message content to ensure clarity and readability on dark backgrounds.

Dark Mode Adjustments

  1. Text and background contrast: Automatically adjusts text color for clear display on dark backgrounds

  2. Message feedback buttons: Adjusts button colors and borders to remain visible in dark mode

  3. Table visuals: Adjusts table borders and background colors for improved readability

  4. Blockquote backgrounds: Adjusts blockquote background tones to differentiate from the main content

3. Streaming Rendering Performance Improvements

WebChat uses real-time streaming to display AI Assistant responses, so users don't need to wait for the full 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 the streaming process

{% hint style="success" %} Users can see the already-generated content in real time while the AI Assistant is still composing its response, without waiting for the complete answer. {% endhint %}

Practical Use Cases

💻 Technical Documentation Assistant

Scenario: When developers ask for code examples, the AI Assistant provides responses with code blocks.

Optimization Effects:

  • Code blocks support syntax highlighting for easier reading

  • Code displays clearly in dark mode

  • Developers can directly copy and use the code

Example Response:

This code reads a CSV file and displays the first 5 rows.

Here are the top three selling products this quarter:

Product Name
Units Sold
Revenue

Product A

1,250

$125,000

Product B

980

$98,000

Product C

856

$85,600

Sales data as of the 20th of this month.

  1. Basic Syntax

    • Variables and data types

    • Conditionals and loops

  2. Advanced Concepts

    • Functions and modules

    • Object-oriented programming

  3. Hands-on Practice

    • Complete small projects

    • Contribute to open source

Each step is recommended to take 2-3 weeks of study.

Last updated

Was this helpful?