Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: !BAD
  • Loading branch information
kellyjosephprice committed Oct 30, 2024
commit acdbf6e3676fa9e4986dc9348a9f40e4c24d4534
67 changes: 67 additions & 0 deletions __tests__/migration/tables.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,71 @@ ${JSON.stringify(
"
`);
});

it('compiles tables with emphasis without converting them to lists', () => {
const md = `
[block:parameters]
{
"data": {
"h-0": "**Shortcut Name**",
"h-1": "**WindowsOS**",
"h-2": "_Apple - macOS_",
"0-0": "*Cut selection*",
"0-1": "__also__\\n\\n_no!_\\n\\n__no no no__",
"0-2": "!BAD"
},
"cols": 3,
"rows": 1,
"align": [
"left",
"left",
"left"
]
}
[/block]
`;

const mdx = rmdx.mdx(rmdx.mdastV6(md));

expect(mdx).toMatchInlineSnapshot(`
"<Table align={["left","left","left"]}>
<thead>
<tr>
<th style={{ textAlign: "left" }}>
**Shortcut Name**
</th>

<th style={{ textAlign: "left" }}>
**WindowsOS**
</th>

<th style={{ textAlign: "left" }}>
*Apple - macOS*
</th>
</tr>
</thead>

<tbody>
<tr>
<td style={{ textAlign: "left" }}>
*Cut selection*
</td>

<td style={{ textAlign: "left" }}>
**also**

*no!*

**no no no**
</td>

<td style={{ textAlign: "left" }}>
!BAD
</td>
</tr>
</tbody>
</Table>
"
`);
});
});