Open
Description
With this version the code breaks when headless tables are used:
cannot read properties of null (reading 'colsnum') in patterns.js line 175:
const calc = tokens[idx].meta.colsnum >> 0;
This bug appears in combination with markdown-it-multimd-table headerless option.
.use(require('markdown-it-multimd-table'), { headerless: true });
.use(require("markdown-it-attrs"))
proposed fix:
Add null check.
const calc = tokens[idx].meta?.colsnum >> 0;
Markdown-it versions: 4.3.0
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
Example input:
| - | - |
| a | b |
| c | d |
Current output:
cannot read properties of null (reading 'colsnum') in patterns.js line 175:
Expected output:
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
<tr>
<td>c</td>
<td>d</td>
</tr>
</tbody>
Metadata
Metadata
Assignees
Labels
No labels