Skip to content

fix(mdxish): normalize spacing for blank-line-split table tags#1493

Open
eaglethrost wants to merge 4 commits into
nextfrom
dimas/rm-16757-mdxish-tables-html-whitespace-entities-on-tag-lines-break
Open

fix(mdxish): normalize spacing for blank-line-split table tags#1493
eaglethrost wants to merge 4 commits into
nextfrom
dimas/rm-16757-mdxish-tables-html-whitespace-entities-on-tag-lines-break

Conversation

@eaglethrost
Copy link
Copy Markdown
Contributor

@eaglethrost eaglethrost commented May 28, 2026

🎫 RM-16757

🎯 What does this PR do?

Fixes a case where <Table> cells that contains HTML tags where the opener & closer tags are not alone in their lines and have text before them.

Note: the root cause isn't what the ticket describes (HTML whitespace entities on tag lines). It's our normalizeTagSpacing symmetry check, when opener and closer are both attached to text but a blank line splits them into separate paragraphs, mdxjs can't match the pair. We now treat that case as needing normalization too.

🧪 QA tips

  • See the new test in __tests__/transformers/mdxish-tables.test.ts — a <Table> with a <div> whose contents span a blank line now parses to a single table node.
  • Try the following markdown in the editor, it should render as a single table:
<Table>
  <thead>
    <tr><th>Icon</th><th>Status</th></tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <div style="text-align:center; color:red">hi

        there</div>
      </td>
      <td>**Enabled**. The device is active.</td>
    </tr>
  </tbody>
</Table>

@eaglethrost eaglethrost requested a review from kevinports May 28, 2026 10:42
Copy link
Copy Markdown
Contributor

@kevinports kevinports left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Comment thread __tests__/transformers/mdxish-tables.test.ts Outdated
Co-authored-by: Kevin Ports <kevin.ports@gmail.com>
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.

2 participants