From 160a621db75c4dfceaf08664db86bfe0f72b0d1b Mon Sep 17 00:00:00 2001 From: Ming Di Leom <2809763-curben@users.noreply.gitlab.com> Date: Sun, 10 Oct 2021 09:46:49 +0000 Subject: [PATCH] fix: compatibility with marked v3 - https://github.com/hexojs/hexo-renderer-marked/pull/208/commits/ab0e0a11463e713e0bd36a7ab03dae407b8c4be6 --- scripts/smartypants.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/smartypants.js b/scripts/smartypants.js index 88abfb0..6545346 100644 --- a/scripts/smartypants.js +++ b/scripts/smartypants.js @@ -24,14 +24,14 @@ const smartypants = (str) => { hexo.extend.filter.register('marked:tokenizer', function(tokenizer) { const { smartypants: isSmarty } = this.config.marked; - tokenizer.inlineText = function(src, inRawBlock) { + tokenizer.inlineText = function(src) { const { rules } = this; // https://github.com/markedjs/marked/blob/b6773fca412c339e0cedd56b63f9fa1583cfd372/src/Tokenizer.js#L643-L658 const cap = rules.inline.text.exec(src); if (cap) { let text; - if (inRawBlock) { + if (this.lexer.state.inRawBlock) { text = cap[0]; } else { text = escape(isSmarty ? smartypants(cap[0]) : cap[0]);