Skip to content

Commit cc4b8fd

Browse files
Merge branch 'next'
2 parents 54a56f8 + 227cbb4 commit cc4b8fd

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: make ci
4747

4848
- name: Upload snapshot diffs
49-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@v5
5050
if: ${{ failure() }}
5151
with:
5252
name: snapshots-diffs
@@ -58,7 +58,7 @@ jobs:
5858
run: make updateSnapshot
5959

6060
- name: Upload snapshots
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v5
6262
if: ${{ failure() }}
6363
with:
6464
name: image-snapshots

__tests__/migration/tables.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
import { migrate } from '../helpers';
22

33
describe('mdx migration of tables', () => {
4+
it('compiles tables with empty cells', () => {
5+
const md = `
6+
| Name | Date |
7+
| ---- | ---- |
8+
| test | |
9+
`;
10+
const mdx = migrate(md);
11+
expect(mdx).toMatchInlineSnapshot(`
12+
"| Name | Date |
13+
| ---- | ---- |
14+
| test | |
15+
"
16+
`);
17+
});
18+
419
it('compiles tables with newlines and inline code', () => {
520
const md = `
621
[block:parameters]

processor/transform/tables-to-jsx.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ const visitor = (table: Table, index: number, parent: Parents) => {
3434
? (cell.children[0] as unknown as Paragraph).children[0]
3535
: cell.children[0];
3636

37+
// If cell is empty there's nothing to visit
38+
if (!content) return EXIT;
39+
3740
// @note: Compatibility with RDMD. Ideally, I'd put this in a separate
3841
// transformer, but then there'd be some duplication.
3942
visit(cell, 'break', (_, breakIndex, breakParent) => {

0 commit comments

Comments
 (0)