Socket
Socket
Sign inDemoInstall

markdown-toc

Package Overview
Dependencies
41
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.11.8 to 0.11.9

13

lib/insert.js
'use strict';
var toc = require('..');
var lazy = require('lazy-cache')(require);
lazy('gray-matter', 'matter');
var utils = require('./utils');

@@ -27,2 +26,6 @@ /**

var newlines = '';
var m = /\n+$/.exec(str);
if (m) newlines = m[0];
// does the file have front-matter?

@@ -32,3 +35,3 @@ if (/^---/.test(str)) {

// doesn't get mistaken for a heading
file = lazy.matter(str);
file = utils.matter(str);
str = file.content;

@@ -52,6 +55,6 @@ }

var res = sections.join('\n\n');
var res = sections.join('\n\n') + newlines;
// if front-matter was found, put it back now
if (file) {
return lazy.matter.stringify(res, file.data);
return utils.matter.stringify(res, file.data);
}

@@ -58,0 +61,0 @@ return res;

{
"name": "markdown-toc",
"description": "Generate a markdown TOC (table of contents) with Remarkable.",
"version": "0.11.8",
"version": "0.11.9",
"homepage": "https://github.com/jonschlinkert/markdown-toc",

@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc