Skip to content
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

[DOCS] Tweaks to docs to make them clearer, regarding hooks and options to lexer/parser #2946

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

audiodude
Copy link
Contributor

Marked version:
HEAD

Markdown flavor: n/a

Description

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • [ x ] no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Aug 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2023 5:49pm

@@ -615,7 +611,7 @@ The parser takes tokens as input and calls the renderer functions.

<h2 id="extend">Access to Lexer and Parser</h2>

You also have direct access to the lexer and parser if you so desire.
You also have direct access to the lexer and parser if you so desire. The `options` parameter is the same options that `marked.use` takes, documented [here](/using_advanced#options).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually isn't the same as what marked.use accepts. marked.use accepts most options but some are different. For example, renderer doesn't need to extend marked.Renderer, it can just be an object (as explained in the bottom of https://marked.js.org/using_pro#use).

The lexer and parser options are the same as passed to marked.setOptions() except they have to be full options objects, they don't get merged with the current or default options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updated explanation, I've tried to fix the docs accordingly.

Copy link
Member

@UziTech UziTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the documentation! 💯

@UziTech UziTech merged commit 4e6acc8 into markedjs:master Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

marked.use isn't respecting the postprocess option
2 participants