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.0.0 to 1.0.1

6

lib/summary.js
var _ = require('lodash');
var dom = require('./dom');
var SELECTOR_LIST = '.olist > ol, ol, ul';
var SELECTOR_LIST = 'ol, ul';
var SELECTOR_LINK = '> a, p > a';

@@ -57,5 +57,7 @@

var $list = $(this);
var $title = $list.prevUntil(SELECTOR_LIST, 'h2, h3, h4').first();
parts.push({
articles: parseList($(SELECTOR_LIST).first(), $)
title: $title.text().trim(),
articles: parseList($list, $)
});

@@ -62,0 +64,0 @@ });

@@ -126,2 +126,4 @@ var _ = require('lodash');

if (part.title) content += this.onTitleStart(2) + this.onText(part.title) + this.onTitleEnd(2);
content += this._summaryArticles(part.articles);

@@ -128,0 +130,0 @@ content += this.onSection();

{
"name": "gitbook-html",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://www.gitbook.com",

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

@@ -16,4 +16,12 @@ var fs = require('fs');

it('should detect parts', function() {
assert.equal(LEXED.parts.length, 3);
describe('Parts', function() {
it('should detect parts', function() {
assert.equal(LEXED.parts.length, 3);
});
it('should detect title', function() {
assert.equal(LEXED.parts[0].title, '');
assert.equal(LEXED.parts[1].title, 'Part 2');
assert.equal(LEXED.parts[2].title, '');
});
});

@@ -25,2 +33,6 @@

it('should detect chapters in other parts', function() {
assert.equal(LEXED.parts[1].articles.length, 1);
});
it('should support articles', function() {

@@ -27,0 +39,0 @@ assert.equal(PART.articles[0].articles.length, 2);

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