Multiple extensions in marked.use()
causing defaults being wrongly overrided
#2649
Labels
L2 - annoying
Similar to L1 - broken but there is a known workaround available for the issue
Marked version:
4.2.2
Describe the bug
As described in the pro doc:
renderer
andtokenizer
options are objects with functions that will be merged into the built-inrenderer
andtokenizer
respectively.Which means people can use multiple extensions written in this way:
However this way will cause errors, see reproduction below.
To Reproduce
Install marked locally and run this simple script:
yields:
Workarounds
You can call
marked.use()
multiple times to avoid this error.Expected behavior
No error occurs.
Cause
The last line of
marked.use()
marked/src/marked.js
Line 263 in fdbbec6
causes an unexpected
renderer
ortokenizer
object being merged intomarked.defaults
.Maybe related(?) #2082
The text was updated successfully, but these errors were encountered: