You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constmarked=require('marked')constcontent='\n## 1. some title\n\nsimple content'marked.use({renderer: {heading(text,level){constescapedText=encodeURIComponent(text).replaceAll('%','.');return`<h${level} id="${escapedText}">${text} </h${level}>`;},},});for(const_ofnewArray(10000).fill(0)){marked.parse(content);}
code will throw error "RangeError: Maximum call stack size exceeded"
some code dig
As I read through the code, it seems that, in simple terms, reassignment rendererFunc leads to recursive-like calls (each execution results in an additional call).
The text was updated successfully, but these errors were encountered:
Marked version: 13
Describe the bug
as title, code will throw "Maximum call stack size exceeded" error
To Reproduce
npm install --save [email protected]
some code dig
As I read through the code, it seems that, in simple terms, reassignment
rendererFunc
leads to recursive-like calls (each execution results in an additional call).The text was updated successfully, but these errors were encountered: