Skip to content

Markdown tables in agent chat output render as literal pipe text, not HTML tables #44

Closed

Description

@JoshuaRowePhantom

Summary

Markdown tables in agent chat output are not rendered as HTML tables — they appear as literal pipe-delimited text (| # | Title | etc. with the |---| separator row shown verbatim).

This is a follow-up to #37 (render assistant text as Markdown). The Markdig pipeline added there only enables DisableHtml():

private static readonly MarkdownPipeline MarkdownPipeline = new MarkdownPipelineBuilder()
    .DisableHtml()
    .Build();

GitHub-Flavored Markdown pipe tables are a Markdig extension that is not enabled by default, so table syntax falls through as plain paragraphs.

Expected

A GFM table renders as an HTML <table> (with <thead>/<tbody>/<tr>/<th>/<td>).

Proposed change

Enable the pipe-tables extension on the pipeline in ChatOutputHtmlRenderer, e.g. .UsePipeTables() (or .UseAdvancedExtensions() if other GFM features such as task lists / autolinks are also wanted). Keep DisableHtml() so raw HTML is still suppressed.

Add .chat-text table / th / td CSS to chat-output-shell.html so the rendered table has borders and padding.

Affected files (expected)

  • Phantom.Workspaces.Agent.Gui/ViewModels/DocumentModels/ChatOutputHtmlRenderer.cs — enable the table extension on the pipeline
  • Phantom.Workspaces.Agent.Gui/Assets/chat-output-shell.html — table CSS
  • Phantom.Workspaces.Agent.Gui.Tests/ChatOutputHtmlModelTests.cs — add a test asserting a pipe table renders to <table>/<th>/<td>

Activity

  1. JoshuaRowePhantom commented on Jun 30, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Verification passed

    Checked: Commit 5a41ad5 (Fix #44) on the \ eatures\ branch, touching three files:

    • \Phantom.Workspaces.Agent.Gui/ViewModels/DocumentModels/ChatOutputHtmlRenderer.cs\
    • \Phantom.Workspaces.Agent.Gui/Assets/chat-output-shell.html\
    • \Phantom.Workspaces.Agent.Gui.Tests/ChatOutputHtmlModelTests.cs\

    Result: Implementation found, all verification criteria satisfied, tests present and green.

    • \ChatOutputHtmlRenderer.cs: \UsePipeTables()\ extension added to the \MarkdownPipelineBuilder\ alongside the existing \DisableHtml()\ and \UseAutoLinks().
    • \chat-output-shell.html: .chat-text table, .chat-text th, and .chat-text td\ CSS rules added with \�order-collapse, cell padding, and header background using theme variables.
    • \ChatOutputHtmlModelTests.cs: \TextContent_RendersMarkdownPipeTable_AsHtmlTable\ test added, asserting the rendered HTML contains <table>, <th>, and <td>. No disabled/skipped tests, no TODOs, no timing-dependent synchronisation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingverifiedIssue has been verified

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions