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

gitbook-markdown

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-markdown - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

lib/toHTML.js

8

lib/index.js

@@ -1,8 +0,10 @@

var htmlParser = require('gitbook-html');
var HTMLParser = require('gitbook-html');
var toHTML = require('./tohtml');
var toMarkdown = require('./tomarkdown');
var toMarkdown = require('./toMarkdown');
var page = require('./page');
module.exports = htmlParser.createParser(toHTML, toMarkdown);
module.exports = HTMLParser.createParser(toHTML, toMarkdown);
// Add the custom page escaping
module.exports.page.prepare = page.prepare;

@@ -8,3 +8,8 @@ var _ = require('lodash');

// Escape a code block using raw blocks
/**
Escape a code block's content using raw blocks
@param {String}
@return {String}
*/
function escape(str) {

@@ -14,3 +19,8 @@ return RAW_START + str + RAW_END;

// Combines annotated nodes
/**
Combines annotated nodes
@param {Array}
@return {String}
*/
function combine(nodes) {

@@ -20,3 +30,9 @@ return _.pluck(nodes, 'raw').join('');

// Add templating "raw" to code blocks
/**
Add templating "raw" to code blocks to
avoid nunjucks processing their content.
@param {String} src
@return {String}
*/
function preparePage(src) {

@@ -23,0 +39,0 @@ var lexed = annotate.blocks(src);

{
"name": "gitbook-markdown",
"version": "1.2.0",
"version": "1.2.1",
"homepage": "https://www.gitbook.com",

@@ -11,3 +11,3 @@ "description": "Parse markdown content for gitbook",

"kramed-text-renderer": "0.2.1",
"gitbook-html": "1.1.0"
"gitbook-html": "1.2.1"
},

@@ -14,0 +14,0 @@ "devDependencies": {

@@ -13,1 +13,5 @@ # Summary

* Unfinished Chapter
----
* Chapter 4

@@ -17,6 +17,6 @@ var fs = require('fs');

assert.equal(LEXED.length, 2);
assert.equal(LEXED[0].path,'en/');
assert.equal(LEXED[0].ref,'en/');
assert.equal(LEXED[0].title,'English');
assert.equal(LEXED[1].path,'fr/');
assert.equal(LEXED[1].ref,'fr/');
assert.equal(LEXED[1].title,'French');

@@ -23,0 +23,0 @@ });

@@ -35,7 +35,7 @@ var fs = require('fs');

it('should detect paths and titles', function() {
assert(PART.articles[0].path);
assert(PART.articles[1].path);
assert(PART.articles[2].path);
assert(PART.articles[3].path);
assert.equal(PART.articles[4].path, null);
assert(PART.articles[0].ref);
assert(PART.articles[1].ref);
assert(PART.articles[2].ref);
assert(PART.articles[3].ref);
assert.equal(PART.articles[4].ref, null);

@@ -50,5 +50,5 @@ assert(PART.articles[0].title);

it('should normalize paths from .md', function() {
assert.equal(PART.articles[0].path,'chapter-1/README.md');
assert.equal(PART.articles[1].path,'chapter-2/README.md');
assert.equal(PART.articles[2].path,'chapter-3/README.md');
assert.equal(PART.articles[0].ref, 'chapter-1/README.md');
assert.equal(PART.articles[1].ref, 'chapter-2/README.md');
assert.equal(PART.articles[2].ref, 'chapter-3/README.md');
});

@@ -55,0 +55,0 @@

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