Skip to content

Commit

Permalink
Merge pull request #3786 from SukkaW/drop-loadsh-for-toc-helper
Browse files Browse the repository at this point in the history
refactor(toc_helper): replace lodash with hexo-util
  • Loading branch information
segayuu authored Oct 22, 2019
2 parents 3448a6d + 68f4303 commit 7e48df3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/helper/toc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

let cheerio;
const escape = require('lodash/escape');
const { escapeHTML } = require('hexo-util');

function tocHelper(str, options = {}) {
if (!cheerio) cheerio = require('cheerio');
Expand Down Expand Up @@ -31,7 +31,7 @@ function tocHelper(str, options = {}) {
headings.each(function() {
const level = +this.name[1];
const id = getId(this);
const text = escape($(this).text());
const text = escapeHTML($(this).text());

lastNumber[level - 1]++;

Expand Down

0 comments on commit 7e48df3

Please sign in to comment.