Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Dec 11, 2025

Closes #2316

Problem

When rendering markdown tables for LLM consumption, link labels and formatted text were duplicated.

Example of the bug:

| [Security configurations](https://...security)Security configurations | Full control |

Cause

The RenderTableCellContent method used cell.Descendants().OfType<Inline>() which returns all nested inline elements. This caused container inlines (links, bold, italic) and their child text to be rendered separately.

Solution

Changed to render the cell's child blocks directly using WriteChildren(cell). This properly handles the inline hierarchy without duplication.

Testing

Added 7 new tests covering:

  • Links in tables and paragraphs
  • Multiple links in same cell
  • Bold and italic text in tables
  • Images in tables
  • Code inline in tables

All 35 LLM markdown tests pass.

@reakaleek reakaleek requested a review from a team as a code owner December 11, 2025 09:08
@reakaleek reakaleek requested a review from cotti December 11, 2025 09:08
@reakaleek reakaleek added the fix label Dec 11, 2025
@reakaleek reakaleek changed the title Fix duplicate content in table cells LLM Markdown: Fix duplicate content in table cells Dec 11, 2025
@reakaleek reakaleek merged commit 475addc into main Dec 11, 2025
28 of 29 checks passed
@reakaleek reakaleek deleted the feature/fix-duplicate-content-in-tables branch December 11, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In markdown output, some table cells have their content duplicated, even tripled sometimes

3 participants