gitbook-plugin-etoc
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -23,6 +23,2 @@ var toc = require('markdown-toc'); | ||
if (_notoc && (!_existstoc)) return page; | ||
if (!(_notoc || _existstoc)) { | ||
// insert <!-- toc --> before the first h2 element | ||
page.content = page.content.replace(/^##([^#])/m, eol + '<!-- toc -->' + eol + '##' + '$1'); | ||
} | ||
@@ -38,2 +34,7 @@ var _mindepth = this.config.get('pluginsConfig.etoc.mindepth') || 3; | ||
if (!(_notoc || _existstoc)) { | ||
// insert <!-- toc --> before the first h2 element | ||
page.content = page.content.replace(/^##([^#])/m, eol + '<!-- toc -->' + eol + '##' + '$1'); | ||
} | ||
// markdown-toc do not pass options to generate, | ||
@@ -40,0 +41,0 @@ // we should escape <!-- toc --> not beginning with whitespace |
@@ -5,3 +5,3 @@ { | ||
"main": "index.js", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"engines": { | ||
@@ -8,0 +8,0 @@ "gitbook": "*" |
7075