diff --git a/lib/plugins/helper/toc.js b/lib/plugins/helper/toc.js index 5f3f7e5f90..ef7d058c7a 100644 --- a/lib/plugins/helper/toc.js +++ b/lib/plugins/helper/toc.js @@ -25,7 +25,7 @@ function tocHelper(str, options) { headings.each(function() { var level = +this.name[1]; var id = $(this).attr('id'); - var text = $(this).text(); + var text = $(this).html(); lastNumber[level - 1]++; diff --git a/test/scripts/helpers/toc.js b/test/scripts/helpers/toc.js index 8b3528ef16..c4e0a84a0e 100644 --- a/test/scripts/helpers/toc.js +++ b/test/scripts/helpers/toc.js @@ -16,7 +16,8 @@ describe('toc', () => { '