Closed penseleit closed 3 years ago
Debugging shows that when I pass an object with options settings into the markdown-it constructor via
use(require("markdown-it-table-of-contents"), options);
the object does not get passed in.
module.exports = (md, o) => { const options = Object.assign({}, defaults, o); const tocRegexp = options.markerPattern;
In the code snippet above in index.js, the object o is undefined in my debugging session.
index.js
o
undefined
I use this object:
{ "includeLevel": [2, 3, 4], "containerClass": "table-of-contents", "slugify": "(s) => encodeURIComponent(String(s).trim().toLowerCase().replace(/\s+/g, '-'))", "markerPattern": "/^\\[\\[toc\\]\\]/im", "listType": "ul", "format": "", "forceFullToc": false, "containerHeaderHtml": "", "containerFooterHtml": "" }
I think it may be related to this issue:
Usage of arguments.callee is prohibited in strict mode https://github.com/chaijs/chai/issues/384
Because I saw this Error in the debugger:
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
Closing as noone seems to want to do a fix for it. If you create a with PR with the necessary fixes I'd accept it.
Debugging shows that when I pass an object with options settings into the markdown-it constructor via
use(require("markdown-it-table-of-contents"), options);
the object does not get passed in.
In the code snippet above in
index.js
, the objecto
isundefined
in my debugging session.I use this object:
I think it may be related to this issue:
Usage of arguments.callee is prohibited in strict mode https://github.com/chaijs/chai/issues/384
Because I saw this Error in the debugger: