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

metalsmith-markdown

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-markdown - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

test/fixtures/basic/build/index.html

4

History.md
0.1.0 - February 5, 2013
------------------------
* add `keys` option
0.0.1 - February 4, 2013
------------------------
:sparkles:

@@ -16,3 +16,4 @@

*
* @param {Object} options
* @param {Object} options (optional)
* @property {Array} keys
* @return {Function}

@@ -22,2 +23,6 @@ */

function plugin(options){
options = options || {};
var keys = options.keys || ['body'];
if (!~keys.indexOf('body')) keys.push('body');
return function(files, metalsmith, done){

@@ -31,3 +36,7 @@ setImmediate(done);

if ('.' != dir) html = dir + '/' + html;
data.body = marked(data.body, options);
keys.forEach(function(key) {
data[key] = marked(data[key], options);
});
delete files[file];

@@ -34,0 +43,0 @@ files[html] = data;

4

package.json

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

"repository": "git://github.com/segmentio/metalsmith-markdown.git",
"version": "0.0.1",
"version": "0.1.0",
"license": "MIT",

@@ -17,2 +17,2 @@ "main": "lib/index.js",

}
}
}
var assert = require('assert');
var equal = require('assert-dir-equal');

@@ -8,3 +9,3 @@ var Metalsmith = require('metalsmith');

it('should convert markdown files', function(done){
Metalsmith('test/fixture')
Metalsmith('test/fixtures/basic')
.use(markdown({

@@ -15,6 +16,19 @@ smartypants: true

if (err) return done(err);
equal('test/fixture/expected', 'test/fixture/build');
equal('test/fixtures/basic/expected', 'test/fixtures/basic/build');
done();
});
});
it('should allow a "keys" option', function(done){
Metalsmith('test/fixtures/keys')
.use(markdown({
keys: ['custom'],
smartypants: true
}))
.build(function(err, files){
if (err) return done(err);
assert.equal('<p><em>a</em></p>\n', files['index.html'].custom);
done();
});
});
});
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