Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Tables within list items stopped rendering since v9.0.0, appearing as plain text instead.

- **Browser Stats**:

  | Computer | Memory Usage |
  | -------- | ------------ |
  | FireFox  | 86%          |

Root cause: processListContinuationLine passed single lines to parseBlocksWithState, but parseTable requires multiple consecutive lines (header + separator + rows) to recognize table syntax.

Fix: Added direct parseTable invocation when continuation line starts with |, matching the existing pattern for fenced code blocks. This allows the table parser to read ahead for all table rows.

if (firstCharAfterIndent === '|') {
  const tableResult = parseTable(source, continuationStart, state, options)
  if (tableResult) {
    lastItem.push(tableResult)
    return { processed: true, newPos: tableResult.endPos, wasBlank: false }
  }
}

Added regression tests covering tables in single and multiple list items.

Original prompt

This section details on the original issue you should resolve

<issue_title>Regression: Tables within a List</issue_title>
<issue_description>Displaying a list of tables no longer works.

- **Browser Stats**:

  | Computer | Memory Usage |
  | -------- | ------------ |
  | FireFox  | 86%          |
  | Chrome   | 80%          |
  | Safari   | 79%          |

Works in VS Code Preview:

Image

Also works in Github:

  • Browser Stats:

    Computer Memory Usage
    FireFox 86%
    Chrome 80%
    Safari 79%

Version: 9.0.0+

Works in: 7.7.10, 8.0.0
</issue_description>

<agent_instructions>Make the minimum possible fix and ensure we have regression test(s) to protect against this going forward. Run bun metrics 3x to ensure no major performance regressions.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@quantizor Thanks for reporting, will get this taken care of.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Ensures tables inside list items are parsed as table nodes (not plain text) and adds regression tests; patch release noted.

  • Parser:
    • In processListContinuationLine (src/parse.ts), when a continuation line starts with |, call parseTable and append the resulting table node; advance position accordingly.
  • Tests:
    • Add regression tests in src/parse.spec.ts for:
      • Tables within a list item.
      • Standalone table parsing.
      • Multiple tables across separate list items.
  • Release:
    • Changeset: patch note documenting the fix.

Written by Cursor Bugbot for commit 59a9810. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 59a9810

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
markdown-to-jsx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@quantizor
Copy link
Owner

@copilot include a changeset with your fix

Copilot AI and others added 2 commits December 12, 2025 04:07
Tables within list items were not being parsed correctly because
processListContinuationLine passed single lines to parseBlocksWithState,
but parseTable requires multiple consecutive lines.

The fix adds table parsing similar to fenced code blocks - calling
parseTable directly when the continuation line starts with |, allowing
the table parser to read multiple lines.

Added regression tests to prevent this issue from recurring.

Co-authored-by: quantizor <[email protected]>
Copilot AI changed the title [WIP] Fix regression of tables within a list Fix tables within list items regression Dec 12, 2025
Copilot AI requested a review from quantizor December 12, 2025 04:11
Copy link
Contributor Author

Copilot AI commented Dec 12, 2025

@copilot include a changeset with your fix

Changeset was already included in commit 59a9810: .changeset/fix-tables-in-lists.md

@quantizor
Copy link
Owner

@copilot investigate blockquotes as well, are tables rendering properly inside them? do we have an existing test for it?

Copy link
Contributor Author

Copilot AI commented Dec 12, 2025

@copilot investigate blockquotes as well, are tables rendering properly inside them? do we have an existing test for it?

Tables inside blockquotes are rendering correctly:

<blockquote><p><strong>Browser Stats</strong>:</p><table><thead><tr><th>Computer</th><th>Memory Usage</th></tr></thead><tbody><tr><td>FireFox</td><td>86%</td></tr><tr><td>Chrome</td><td>80%</td></tr></tbody></table></blockquote>

No existing test for this specific case. Would you like me to add one?

@quantizor quantizor marked this pull request as ready for review December 12, 2025 04:57
@quantizor quantizor merged commit 08dfe8a into main Dec 12, 2025
12 checks passed
@quantizor quantizor deleted the copilot/fix-list-tables-display branch December 12, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Tables within a List

2 participants