-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderer not merged when used in marked() options #2082
Comments
If you would like to create a PR to make the documentation better it would be much appreciated. 😁👍 |
I would like to create a PR fixing this issue(to update the documentation), may you please guide me. :) |
@madhavanand-github You will have to create a PR that updates the files in the |
May you tell me the content to be updated. |
This is just a documentation change so no JavaScript experience is needed. I don't know what exactly needs to change. |
@foxbunny I would like to fix this issue. |
@YashasviChaurasia sounds good 👍 you can take it on. |
@UziTech Could you specify exactly where should I do the documentation changes? |
I was also tripped up by the wording here, specifically the bit about merging defaults. Something like the following text would help make it clear that new renderers are not merged with the default methods. Changes are in bold.
|
@stephenhutchings PRs are appreciated 😁👍 |
Update text in line with the [issue comments](markedjs#2082 (comment))
Marked version: 2.0.6
Markdown flavor: n/a
Expectation
Based on the documentation for marked.use(), which states that:
and also based on the fact that description of
renderer
option in the Advanced section I would expect that the option passed tomarked()
would behave the same way as the option passed tomarked.use()
.I therefore passed in a renderer with just
image()
implemented.Result
I got an exception that says
renderer.paragraph()
is not a function.After looking at the source code, it does not seem like the renderer is "merged into" anything when passed directly to
marked()
. Documentation should clarify this, preferably before linking to the section on extending.What was attempted
Call stack & console log
TypeError: this.renderer.paragraph is not a function
The text was updated successfully, but these errors were encountered: