From 22ead33a0fbb2f21a5600a4d9bd60885ea94ddf5 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 30 Jun 2021 22:42:06 -0400 Subject: [PATCH] chore(docs): fix async highlight example (#2123) --- docs/USING_ADVANCED.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index 88357de7..95ae48a3 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -86,7 +86,9 @@ marked.setOptions({ } }); -console.log(marked(markdownString)); +marked(markdownString, (err, html) => { + console.log(html); +}); ``` In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming language to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete.