New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-plugin-etoc

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-etoc - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

12

index.js

@@ -47,3 +47,5 @@ var toc = require('markdown-toc');

slugify: function (str) {
return slug(str);
// handle '{#foo-bar}' syntax (urls)
var m = str.match(/\{#([^\}]+)\}\s*$/);
return m ? m[1].trim() : slug(str);
},

@@ -53,2 +55,10 @@ maxdepth: _maxdepth

page.content = page.content.replace('<!-- rawtoc -->', '<!-- toc -->');
// handle '{#foo-bar}' syntax (names)
var parts = page.content.split('<!-- tocstop -->');
parts[0] = parts[0].replace(
/\[([^\]\{]+)\{#([^\}]+)\}\]\(#([^\)]+)\)/g,
function(a, b, c, d) { return c != d ? a : ('[' + b.trim() + '](#' + c + ')'); });
page.content = parts.join('<!-- tocstop -->');
return page;

@@ -55,0 +65,0 @@ },

2

package.json

@@ -5,3 +5,3 @@ {

"main": "index.js",
"version": "1.2.1",
"version": "1.2.2",
"engines": {

@@ -8,0 +8,0 @@ "gitbook": "*"

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