Skip to content

Commit

Permalink
Merge b8ca03c into 568e5e9
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] committed Dec 31, 2021
2 parents 568e5e9 + b8ca03c commit 16d793a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/renderer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict';

const marked = require('marked');
const { marked } = require('marked');

let JSDOM,
createDOMPurify;

const { escape } = require('marked/src/helpers');
const { encodeURL, slugize, stripHTML, url_for, isExternalLink } = require('hexo-util');
const { encodeURL, slugize, stripHTML, url_for, isExternalLink, escapeHTML: escape } = require('hexo-util');
const MarkedRenderer = marked.Renderer;
const MarkedTokenizer = marked.Tokenizer;
const { basename, dirname, extname, join } = require('path').posix;
Expand Down Expand Up @@ -188,7 +187,7 @@ class Tokenizer extends MarkedTokenizer {
const cap = rules.inline.text.exec(src);
if (cap) {
let text;
if (this.lexer.state.inRawBlock) {
if (this.lexer.state.inRawBlock || this.rules.inline.url.exec(src)) {
text = cap[0];
} else {
text = escape(isSmarty ? smartypants(cap[0], quotes) : cap[0]);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"license": "MIT",
"dependencies": {
"hexo-util": "^2.5.0",
"marked": "^3.0.4",
"marked": "^4.0.1",
"dompurify": "^2.3.0",
"jsdom": "^19.0.0"
},
Expand Down

0 comments on commit 16d793a

Please sign in to comment.