Skip to content

Commit

Permalink
One possible fix for #2198
Browse files Browse the repository at this point in the history
  • Loading branch information
黄文睿 authored Mar 8, 2017
1 parent 5a7ea3e commit ff2e465
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/helper/toc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var cheerio;
var escapeHTML = require('hexo-util').escapeHTML;

function tocHelper(str, options) {
options = options || {};
Expand All @@ -25,7 +26,7 @@ function tocHelper(str, options) {
headings.each(function() {
var level = +this.name[1];
var id = $(this).attr('id');
var text = $(this).text();
var text = escapeHTML($(this).text());

lastNumber[level - 1]++;

Expand Down

0 comments on commit ff2e465

Please sign in to comment.