From 6e55d653379082760242c170d69eb538528eeb2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Sep 2021 01:05:39 +0000 Subject: [PATCH 1/2] chore(deps): bump marked from 2.1.3 to 3.0.4 Bumps [marked](https://github.com/markedjs/marked) from 2.1.3 to 3.0.4. - [Release notes](https://github.com/markedjs/marked/releases) - [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js) - [Commits](https://github.com/markedjs/marked/compare/v2.1.3...v3.0.4) --- updated-dependencies: - dependency-name: marked dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5bb89ce..9da826c 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "license": "MIT", "dependencies": { "hexo-util": "^2.5.0", - "marked": "^2.1.3", + "marked": "^3.0.4", "dompurify": "^2.3.0", "jsdom": "^17.0.0" }, From ab0e0a11463e713e0bd36a7ab03dae407b8c4be6 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 19 Sep 2021 14:53:53 +0800 Subject: [PATCH 2/2] fix: https://github.com/markedjs/marked/pull/2124 --- README.md | 2 +- lib/renderer.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 99dc842..42d87e6 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ marked: - **smartypants** - Use "smart" typographic punctuation for things like quotes and dashes. - **quotes** - Defines the double and single quotes used for substituting regular quotes if **smartypants** is enabled. * Example: '«»“”' - * "double" will be turned into «single» + * "double" will be turned into «double» * 'single' will be turned into “single” * Both double and single quotes substitution must be specified, otherwise it will be silently ignored. - **modifyAnchors** - Transform the anchorIds into lower case (`1`) or upper case (`2`). diff --git a/lib/renderer.js b/lib/renderer.js index e31b91a..47f5944 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -216,7 +216,7 @@ class Tokenizer extends MarkedTokenizer { } // Override smartypants - inlineText(src, inRawBlock) { + inlineText(src) { const { options, rules } = this; const { quotes, smartypants: isSmarty } = options; @@ -224,7 +224,7 @@ class Tokenizer extends MarkedTokenizer { 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], quotes) : cap[0]);