Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-html

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-html - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

5

lib/summary.js

@@ -100,2 +100,7 @@ var _ = require('lodash');

// Last part might be empty
if (previousPart !== null) {
parts.push(previousPart);
}
return parts;

@@ -102,0 +107,0 @@ }

2

package.json
{
"name": "gitbook-html",
"version": "1.3.2",
"version": "1.3.3",
"homepage": "https://www.gitbook.com",

@@ -5,0 +5,0 @@ "description": "Parse HTML content for gitbook",

@@ -9,2 +9,3 @@ var fs = require('fs');

var LEXED, PART;
var LEXED_EMPTY;

@@ -17,2 +18,5 @@ before(function() {

var CONTENT_EMPTY = fs.readFileSync(
path.join(__dirname, './fixtures/SUMMARY-EMPTY.html'), 'utf8');
LEXED_EMPTY = summary(CONTENT_EMPTY);
});

@@ -32,8 +36,18 @@

it('should detect empty parts', function() {
var CONTENT_EMPTY = fs.readFileSync(
path.join(__dirname, './fixtures/SUMMARY-EMPTY.html'), 'utf8');
var LEXED_EMPTY = summary(CONTENT_EMPTY);
assert.equal(LEXED_EMPTY.parts.length, 4);
assert.equal(LEXED_EMPTY.parts[2].title, 'Empty part');
var partTitles = LEXED_EMPTY.parts.map(function (part) {
return part.title;
});
var expectedTitles = [
'First empty part',
'Part 1',
'',
'Empty part',
'Part 2',
'Penultimate empty part',
'Last empty part'
];
assert.equal(LEXED_EMPTY.parts.length, 7);
expectedTitles.forEach(function (title, index) {
assert.equal(partTitles[index], title);
});
});

@@ -40,0 +54,0 @@ });

Sorry, the diff of this file is not supported yet

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