Skip to content

Commit

Permalink
refactor(toc_helper): relpace lodash with hexo-util
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Oct 21, 2019
1 parent 9ba38e9 commit b8ee1bf
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 b8ee1bf

Please sign in to comment.