gitbook-plugin-etoc
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -36,9 +36,6 @@ var toc = require('markdown-toc'); | ||
// markdown-toc do not pass options to generate func, | ||
// markdown-toc do not pass options to generate, | ||
// we should escape <!-- toc --> not beginning with whitespace | ||
page.content = page.content.replace(/^(\S.*)<!-- toc -->(.*)$/m, '$1<!-- rawtoc -->$2'); | ||
// we do not process <!-- tocstop --> | ||
var options = {}; | ||
options.regex = /^\s*(?:<!-- toc -->)\s*$/im; | ||
page.content = toc.insert(page.content, options, { | ||
page.content = toc.insert(page.content, { | ||
slugify: function (str) { | ||
@@ -45,0 +42,0 @@ return slug(str); |
@@ -5,3 +5,3 @@ { | ||
"main": "index.js", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"engines": { | ||
@@ -8,0 +8,0 @@ "gitbook": "*" |
7019
101