Socket
Socket
Sign inDemoInstall

remark-toc

Package Overview
Dependencies
Maintainers
13
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-toc - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0

license

28

index.js

@@ -1,19 +0,19 @@

'use strict';
'use strict'
var slug = require('remark-slug');
var util = require('mdast-util-toc');
var slug = require('remark-slug')
var util = require('mdast-util-toc')
module.exports = toc;
module.exports = toc
var DEFAULT_HEADING = 'toc|table[ -]of[ -]contents?';
var DEFAULT_HEADING = 'toc|table[ -]of[ -]contents?'
function toc(options) {
var settings = options || {};
var heading = settings.heading || DEFAULT_HEADING;
var depth = settings.maxDepth || 6;
var tight = settings.tight;
var settings = options || {}
var heading = settings.heading || DEFAULT_HEADING
var depth = settings.maxDepth || 6
var tight = settings.tight
this.use(slug);
this.use(slug)
return transformer;
return transformer

@@ -27,6 +27,6 @@ /* Adds an example section based on a valid example

tight: tight
});
})
if (result.index === null || result.index === -1 || !result.map) {
return;
return
}

@@ -39,4 +39,4 @@

node.children.slice(result.endIndex)
);
)
}
}
{
"name": "remark-toc",
"version": "5.0.0",
"version": "5.1.0",
"description": "Generate a Table of Contents (TOC) for Markdown files",

@@ -30,28 +30,36 @@ "license": "MIT",

"remark-slug": "^5.0.0",
"mdast-util-toc": "^2.0.0"
"mdast-util-toc": "^3.0.0"
},
"devDependencies": {
"browserify": "^14.0.0",
"esmangle": "^1.0.0",
"browserify": "^16.0.0",
"is-hidden": "^1.1.0",
"negate": "^1.0.0",
"nyc": "^11.0.0",
"remark": "^8.0.0",
"remark-cli": "^4.0.0",
"remark-preset-wooorm": "^3.0.0",
"nyc": "^13.0.0",
"prettier": "^1.14.2",
"remark": "^10.0.0",
"remark-cli": "^6.0.0",
"remark-preset-wooorm": "^4.0.0",
"tape": "^4.0.0",
"xo": "^0.18.0"
"tinyify": "^2.4.3",
"xo": "^0.23.0"
},
"scripts": {
"build-md": "remark *.md -qfo",
"build-bundle": "browserify index.js --no-builtins -s remarkTOC > remark-toc.js",
"build-mangle": "esmangle remark-toc.js > remark-toc.min.js",
"build": "npm run build-md && npm run build-bundle && npm run build-mangle",
"lint": "xo",
"format": "remark *.md -qfo && prettier --write \"**/*.js\" && xo --fix",
"build-bundle": "browserify . -s remarkToc > remark-toc.js",
"build-mangle": "browserify . -s remarkToc -p tinyify > remark-toc.min.js",
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test/index.js",
"test": "npm run build && npm run lint && npm run test-coverage"
"test": "npm run format && npm run build && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"space": true,
"prettier": true,
"esnext": false,

@@ -58,0 +66,0 @@ "ignores": [

@@ -32,12 +32,12 @@ # remark-toc [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]

```javascript
var vfile = require('to-vfile');
var remark = require('remark');
var toc = require('remark-toc');
var vfile = require('to-vfile')
var remark = require('remark')
var toc = require('remark-toc')
remark()
.use(toc)
.process(vfile.readSync('example.md'), function (err, file) {
if (err) throw err;
console.log(String(file));
});
.process(vfile.readSync('example.md'), function(err, file) {
if (err) throw err
console.log(String(file))
})
```

@@ -71,4 +71,4 @@

* Looks for the first heading containing `"Table of Contents"`, `"toc"`,
or `table-of-contents` (case insensitive, supports alt/title attributes
* Looks for the first heading containing `'Table of Contents'`, `'toc'`,
or `'table-of-contents'` (case insensitive, supports alt/title attributes
for links and images too)

@@ -83,3 +83,3 @@ * Removes all following contents until an equal or higher heading is found

`string?`, default: `"toc|table[ -]of[ -]contents?"` — Heading to look for,
`string?`, default: `'toc|table[ -]of[ -]contents?'` — Heading to look for,
wrapped in `new RegExp('^(' + value + ')$', 'i')`.

@@ -111,3 +111,4 @@

See [`contribute.md` in `remarkjs/remark`][contribute] for ways to get started.
See [`contributing.md` in `remarkjs/remark`][contributing] for ways to get
started.

@@ -135,3 +136,3 @@ This organisation has a [Code of Conduct][coc]. By interacting with this

[license]: LICENSE
[license]: license

@@ -144,4 +145,4 @@ [author]: http://wooorm.com

[contribute]: https://github.com/remarkjs/remark/blob/master/contributing.md
[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md
[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md
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