-
Notifications
You must be signed in to change notification settings - Fork 62
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
├── markdown-it-abbr@2.0.0
├── markdown-it-anchor@9.2.0
├── markdown-it-attrs@4.3.1
├── markdown-it-codetabs@1.2.0
├── markdown-it-container@4.0.0
├── markdown-it-footnote@4.0.0
├── markdown-it-multimd-table@4.2.3
├── markdown-it-plantuml-ex@1.0.0
├── markdown-it-task-lists@2.1.1
├── markdown-it@14.1.0Example 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>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels