Comparing version 0.2.0 to 0.2.1
@@ -15,2 +15,4 @@ 'use strict'; | ||
function getHashedHeaders (_lines) { | ||
var inCodeBlock = false; | ||
// Turn all headers into '## xxx' even if they were '## xxx ##' | ||
@@ -23,2 +25,8 @@ function normalize(header) { | ||
return _lines | ||
.filter(function (x) { | ||
if (x.match(/^```/)) { | ||
inCodeBlock = !inCodeBlock; | ||
} | ||
return !inCodeBlock; | ||
}) | ||
.map(function (x, index) { | ||
@@ -25,0 +33,0 @@ var match = /^(\#{1,8})[ ]*(.+)$/.exec(x); |
@@ -5,3 +5,3 @@ { | ||
"description": "Generates TOC for markdown files of local git repo.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -58,1 +58,19 @@ 'use strict'; | ||
) | ||
check( | ||
[ '## Title should be included' | ||
, '' | ||
, '```js' | ||
, 'function foo () {' | ||
, ' // ## This title should be ignored' | ||
, '}' | ||
, '## This title should also be ignored' | ||
, '```' | ||
, '' | ||
, '## Title should also be included' | ||
].join('\n') | ||
, [ '**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n' | ||
, '- [Title should be included](#title-should-be-included)\n' | ||
, '- [Title should also be included](#title-should-also-be-included)\n\n' | ||
].join('') | ||
) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11235
253
0
9