Skip to content

Markdown Tables Always Jammed in Gateway WebChat #20410

@myaifren

Description

@myaifren

Summary

All markdown tables render as jammed inline text in the Gateway Dashboard WebChat interface (http://127.0.0.1:18789/chat), regardless of proper formatting with blank lines.

Steps to reproduce

  1. Open OpenClaw Gateway Dashboard (http://127.0.0.1:18789/chat)
  2. Send a message with a properly formatted markdown table:
Text before.

| Col1 | Col2 |
|------|------|
| A    | B    |

Text after.
  1. Observe the rendered output

Expected behavior

Properly formatted table HTML:

<div class="chat-text">
  <p>Text before.</p>
  <table>
    <thead><tr><th>Col1</th><th>Col2</th></tr></thead>
    <tbody><tr><td>A</td><td>B</td></tr></tbody>
  </table>
  <p>Text after.</p>
</div>

Actual behavior

Jammed inline text - entire message collapses into a single paragraph:

Visual: All text runs together on one line, table structure lost.

HTML:

<div class="chat-text"><p>Text before. | Col1 | Col2 | |------|------| | A | B | Text after.</p></div>

OpenClaw version

2026.2.17

Operating system

macOS Darwin 25.2.0 (arm64)

Install method

Standard install via npm/CLI per OpenClaw documentation

Logs, screenshots, and evidence

**Root Cause Analysis:**
Through DevTools HTML inspection, we determined that **the Gateway collapses/override all newline characters before markdown parsing**:

| Input | Processed | Result |
|-------|-----------|--------|
| `\n\n` (blank lines) | ` ` (single space) | No block separation |
| `\n` (newlines) | ` ` (single space) | Single paragraph only |

The Lit template markers (`<!--?lit$...-->`) show content is rendered as a single interpolated string, preventing the markdown parser from recognizing block-level elements.

**Browser Developer Tools Output:**

<div class="chat-bubble has-copy fade-in">
  <!--?lit$918486889$-->
  <div class="chat-text" dir="ltr">
    <!--?lit$918486889$-->
    <p><strong>EVEN SIMPLE TABLE JAMMING...</strong> | Scenario | Result |...</p>
  </div>
</div>

Impact and severity

Component: Gateway Dashboard WebChat
Severity: Medium - Blocks table formatting, reduces chat readability
Impact Areas:

  • Tables unusable in WebChat
  • Numbered lists (1. 2. 3.) also jam
  • Multi-paragraph messages collapse
  • Forces use of bullet lists and inline formatting only
Image

Additional information

Attempted Workaround: Browser Extension

We developed a Chrome extension (OpenClaw Dashboard Table Preserver v1.0.2) to repair jammed tables client-side:

  • Approach: MutationObserver, CSS !important rules, repair logic
  • Result: Extensions cannot fix this
  • Reason: By the time the extension sees the DOM, newlines are already collapsed server-side

Conclusion

This is a server-side markdown preprocessing issue - the Gateway normalizes newlines before the markdown parser runs. Extensions cannot fix it; the parser must preserve block-level structure.

Suggested Fix

Primary: Preserve block-level markdown structure by not collapsing newlines before parsing. Users expect standard markdown to work naturally - tables should render as tables, lists as lists.


Feature Request (Optional)

Terminal / Preformatted Mode

A mode that preserves exact text formatting with terminal-like aesthetics:

Mode Render Style Parse Tables Best For
Markdown (current) Proportional font ✅ Yes Conversational text
Preformatted Monospace, exact ❌ No Code, logs, data
Terminal Monospace + terminal aesthetic ❌ No Technical sessions

Use cases:

  • Sharing code snippets with indentation and newlines intact
  • Pasting log output or error messages for debugging
  • Configuration files (JSON, YAML, nginx.conf)
  • Clean copy-paste to web forms (no bold/italic artifacts)
  • API keys or structured data where exact characters matter

Labels: bug, ui, markdown, gateway, webchat
Reporter: User via Fren AI session
Date: 2026-02-18

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions