From 68f43034a9935e481cec66cbbc26628c93ea416b Mon Sep 17 00:00:00 2001 From: SukkaW Date: Mon, 21 Oct 2019 22:51:38 +0800 Subject: [PATCH] refactor(toc_helper): replace lodash with hexo-util --- lib/plugins/helper/toc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/helper/toc.js b/lib/plugins/helper/toc.js index ddf4023816..3601588284 100644 --- a/lib/plugins/helper/toc.js +++ b/lib/plugins/helper/toc.js @@ -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'); @@ -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]++;