From f101dd772ae1187a22c292b64a6911ec0a210fee Mon Sep 17 00:00:00 2001 From: dom-o Date: Thu, 22 May 2025 11:32:56 -0400 Subject: [PATCH] Fix 'Using another markdown library' code example - Rename markdownIt to distinguish from MarkdownIt by something other than just capitalization. - Fix typo. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e55bedf..adb77c6 100644 --- a/README.md +++ b/README.md @@ -227,12 +227,12 @@ If you don't want to use marked, you can use another markdown rendering library ```js import MarkdownIt from 'markdown-it' -let markdownIt +let markdownItInstance metalsmith.use(markdown({ render(source, opts, context) { - if (!markdownIt) markdownIt = new MarkdownIt(opts) - if (context.key == 'contents') return mdIt.render(source) - return markdownIt.renderInline(source) + if (!markdownItInstance) markdownItInstance = new MarkdownIt(opts) + if (context.key == 'contents') return markdownItInstance.render(source) + return markdownItInstance.renderInline(source) }, // specify markdownIt options here engineOptions: { ... }