Marked version: 16.4.2
Describe the bug
import { marked } from "marked";
const lexer = new marked.Lexer();
const tokensA = marked.Lexer.lex("Test");
const tokensB = lexer.lex("Test");
The values of tokensA and tokensB should be the same instead tokensA is
[
{
"type": "paragraph",
"raw": "Test",
"text": "Test",
"tokens": [
{
"type": "text",
"raw": "Test",
"text": "Test",
"escaped": false
}
]
}
]
as expected but tokensB is
[
{
"type": "paragraph",
"raw": "Test",
"text": "Test",
"tokens": []
}
]
The problem is probably related to the shared _defaults option object.
To Reproduce
Steps to reproduce the behavior: Run the code above
Expected behavior
I would expect both options to give the same result.