Skip to content

Commit

Permalink
docs: add useNewRenderer note (#3340)
Browse files Browse the repository at this point in the history
* docs: add useNewRenderer note

* Apply suggestions from code review

---------

Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
UziTech and styfle committed Jun 24, 2024
1 parent fa2ef9d commit 642c30c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/USING_PRO.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Marked provides methods for directly overriding the `renderer` and `tokenizer` f

<h2 id="renderer">The Renderer : <code>renderer</code></h2>

<!-- TODO: Remove this after next major version -->

🚨 Marked v13 changed the renderer to accept tokens. To opt in to these new renderer functions add `useNewRenderer: true` to the extension. See [the v13 release notes](https://github.com/markedjs/marked/releases/tag/v13.0.0) for an example 🚨

The renderer defines the HTML output of a given token. If you supply a `renderer` in the options object passed to `marked.use()`, any functions in the object will override the default handling of that token type.

Calling `marked.use()` to override the same function multiple times will give priority to the version that was assigned *last*. Overriding functions can return `false` to fall back to the previous override in the sequence, or resume default behavior if all overrides return `false`. Returning any other value (including nothing) will prevent fallback behavior.
Expand Down

0 comments on commit 642c30c

Please sign in to comment.