From 642c30c81f776f1277d9c3c3d6f9edee7d1b7152 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Mon, 24 Jun 2024 09:47:38 -0500 Subject: [PATCH] docs: add useNewRenderer note (#3340) * docs: add useNewRenderer note * Apply suggestions from code review --------- Co-authored-by: Steven --- docs/USING_PRO.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index 1e9176e15d..fa873791cd 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -56,6 +56,10 @@ Marked provides methods for directly overriding the `renderer` and `tokenizer` f

The Renderer : renderer

+ + +🚨 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.