We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0be0335 commit 918a771Copy full SHA for 918a771
lib/index.js
@@ -148,7 +148,7 @@ const pageTreeview = module.exports = {
148
149
let minLevel = 6;
150
151
- const _calcLevel = str => str.split('').filter(ch => ch === '#').length;
+ const _calcLevel = str => (/^#+/.exec(str) || [''])[0].length;
152
const headers = [].concat(content.match(/^(#)+(\s)*(.*)\n/g))
153
.concat(content.match(/\n(#)+(\s)*(.*)/g))
154
.map(x => {
0 commit comments