Tony Brix
Tony Brix
If we wanted to fix this in marked it would probably be best to set `this.tokenizer.lexer = this;` in `Lexer.blockTokens` and `Lexer.inlineTokens`. We would also want to do the same...
You can create an extension that does this 😁👍
Node 20+ is able to load esm with `require('marked')` so there would be no benefit to using cjs see https://nodejs.org/docs/latest/api/modules.html#loading-ecmascript-modules-using-require
require('marked') does not work on client side anyway. Browsers don't have a require function. If you are using a framework that does bundling and hydration your should create an issue...
Marked had a template to help create an extension: https://github.com/markedjs/marked-extension-template You can add it to the [known extensions](https://marked.js.org/using_advanced#extensions) once you publish it 😁👍
Could this be an extension? something that uses the `processAllTokens` hook to allow updating the tokens? similar to how I did the [token position extension](https://github.com/UziTech/marked-token-position)
I think this will be a breaking change since the typescript types are changing
The tests aren't passing
What AI model are you using to write this code?
Why are the docs being updated in this PR?