Skip to content

Fix tables with inline code in multiple cells - #153

Open
mohsensc wants to merge 1 commit into
Lex-Inc:mainfrom
mohsensc:table-inline-code-cells
Open

mohsensc wants to merge 1 commit into
Lex-Inc:mainfrom
mohsensc:table-inline-code-cells

Conversation

@mohsensc

Copy link
Copy Markdown

The pipe guard from #39 matched from the closing backtick of one code span, across |, to the opening backtick of the next one. So any row with inline code in two or more cells was kept as a raw block, and the table never rendered.

This keeps the old regex as a required check and only skips protection when every cell's code spans open and close inside that cell. Escaped or unmatched backticks still count as protected, so it can only protect fewer tables than main does. ``a | b`` still stays raw.

Fixes #94

Tested:

  • new test for the [bug] Multiple inline code boxes in single row causes entire table to not render #94 repro (fails on main), plus a couple of pipe-in-code cases
  • pnpm lint, pnpm test, pnpm build and pnpm test:selectors all pass
  • fuzzed ~370k random rows against main, and it never lets through a pipe that's actually inside code
  • pnpm test:smoke (11/12, the review rail animation test flaked once and passed on rerun) and a headless browser check of the repro, both on an earlier revision with the same behavior

Thanks @nbbaier for reporting and @mjkerrison for confirming it on v0.1.9.

btw, thanks for having this open source, it's been a game changer in my workflows. -mohsen

The pipe check matched the text between two code spans, so any table
row with code in 2+ cells was kept as a raw block. Keep the check, but
skip protection when every cell's code spans open and close inside
that cell, since then no pipe can be inside code.

Fixes Lex-Inc#94
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@mohsensc is attempting to deploy a commit to the Lex Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

[bug] Multiple inline code boxes in single row causes entire table to not render

1 participant