-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headless tables break extension #161
Comments
The headerless tables feature looks like from |
this is very useful contribute |
Hi @arjangeertsema 👋 Thanks for reporting and fix. I'll try to reproduce and create a regression test. Until then, @yiiman-dev, version v4.1.6 should probably be fine. |
Hi again. I'm unable to reproduce. Maybe you can supply a minimum reproducible example? Here is what I tried: /* eslint-env es6 */
const md = require('markdown-it')();
const markdownItAttrs = require('./');
md.use(markdownItAttrs)
.use(require('markdown-it-multimd-table'));
const src = `| - | - |
| a | b |
| c | d |`;
const res = md.render(src);
console.log(res); // eslint-disable-line which does not crash. Edit: Use example input for issue. |
This cames from
|
OK, I believe I included it: .use(require('markdown-it-multimd-table')); Anyhow, I added general error handling in v4.3.1, which might solve the issue until I can reproduce the error. |
Sorry for this, I'm also trying reproduce and thinking about how to improve the multiple |
try notation .use(require('markdown-it-multimd-table'), { headerless: true }); |
@arve0 thanks for new update. |
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;
proposed fix:
Add null check.
const calc = tokens[idx].meta?.colsnum >> 0;
Markdown-it versions: 4.3.0
Example input:
Current output:
Expected output:
The text was updated successfully, but these errors were encountered: