Socket
Socket
Sign inDemoInstall

doctoc

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doctoc - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

8

lib/transform.js

@@ -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);

2

package.json

@@ -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('')
)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc