Skip to content

Commit

Permalink
chore(deps): bump marked from 3.0.8 to 4.0.1 (#214)
Browse files Browse the repository at this point in the history
* chore(deps): bump marked from 3.0.8 to 4.0.1

Bumps [marked](https://github.com/markedjs/marked) from 3.0.8 to 4.0.1.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](markedjs/marked@v3.0.8...v4.0.1)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: marked.js 4.0.0 uses named export

* refactor(renderer): use hexo-util's escapeHTML

* fix: return raw if is url in inlineText function

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sukka <isukkaw@gmail.com>
Co-authored-by: yoshinorin <yoshinorin.net@outlook.com>
  • Loading branch information
3 people authored Jan 15, 2022
1 parent 20e9d00 commit 9c48448
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 9c48448

Please sign in to comment.