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

metalsmith-metallic

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-metallic - npm Package Compare versions

Comparing version 0.3.1 to 1.0.0

6

lib/index.js

@@ -45,3 +45,3 @@ var debug = require('debug')('metalsmith-metallic');

replacements = [];
while (end.test(remainder)) {

@@ -87,6 +87,6 @@ var match = remainder.match(end),

files[file].contents = replacements.join('');
debug(files[file].contents);
files[file].contents = new Buffer(replacements.join(''));
debug(files[file].contents.toString());
});
};
}

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

"repository": "git://github.com/weswigham/metalsmith-metallic.git",
"version": "0.3.1",
"version": "1.0.0",
"license": "MIT",

@@ -14,3 +14,3 @@ "main": "lib/index.js",

"debug": "~2.1",
"highlight.js": "~8.3",
"highlight.js": "~8.9.1",
"entities": "~1.1"

@@ -22,2 +22,2 @@ },

}
}
}
# metalsmith-metallic <img src="https://travis-ci.org/weswigham/metalsmith-metallic.svg">
# metalsmith-metallic [<img src="https://travis-ci.org/weswigham/metalsmith-metallic.svg">](https://travis-ci.org/weswigham/metalsmith-metallic)

@@ -41,2 +41,2 @@ A [Metalsmith](http://metalsmith.io) plugin to highlight code in Markdown files.

MIT
MIT

@@ -8,3 +8,3 @@ <pre><code class="hljs csharp"><span class="hljs-keyword">using</span> System;

<span class="hljs-comment"><span class="hljs-xmlDocTag">///</span> <span class="hljs-xmlDocTag">&lt;summary&gt;</span>The entry point to the program.<span class="hljs-xmlDocTag">&lt;/summary&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> <span class="hljs-title">Main</span><span class="hljs-params">(<span class="hljs-keyword">string</span>[] args)</span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> <span class="hljs-title">Main</span>(<span class="hljs-params"><span class="hljs-keyword">string</span>[] args</span>)
</span>{

@@ -21,3 +21,3 @@ Console.WriteLine(<span class="hljs-string">"Hello, World!"</span>);

<span class="hljs-function"><span class="hljs-keyword">async</span> Task&lt;<span class="hljs-keyword">int</span>&gt; <span class="hljs-title">AccessTheWebAsync</span><span class="hljs-params">()</span>
<span class="hljs-function"><span class="hljs-keyword">async</span> Task&lt;<span class="hljs-keyword">int</span>&gt; <span class="hljs-title">AccessTheWebAsync</span>(<span class="hljs-params"></span>)
</span>{

@@ -24,0 +24,0 @@ <span class="hljs-comment">// ...</span>

Non code
<pre><code class="hljs"><span class="hljs-built_in">local</span> <span class="hljs-built_in">var</span> <span class="hljs-subst">=</span> <span class="hljs-string">"untyped code"</span></code></pre>
<pre><code class="hljs"><span class="hljs-keyword">local</span> <span class="hljs-keyword">var</span> = <span class="hljs-string">"untyped code"</span></code></pre>

@@ -5,0 +5,0 @@ <pre><code class="hljs js"><span class="hljs-keyword">var</span> t = <span class="hljs-string">'typed code'</span></code></pre>

@@ -8,3 +8,3 @@ <pre><code class="hljs csharp"><span class="hljs-keyword">using</span> System;

<span class="hljs-comment"><span class="hljs-xmlDocTag">///</span> <span class="hljs-xmlDocTag">&lt;summary&gt;</span>The entry point to the program.<span class="hljs-xmlDocTag">&lt;/summary&gt;</span></span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> <span class="hljs-title">Main</span><span class="hljs-params">(<span class="hljs-keyword">string</span>[] args)</span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> <span class="hljs-title">Main</span>(<span class="hljs-params"><span class="hljs-keyword">string</span>[] args</span>)
</span>{

@@ -21,3 +21,3 @@ Console.WriteLine(<span class="hljs-string">"Hello, World!"</span>);

<span class="hljs-function"><span class="hljs-keyword">async</span> Task&lt;<span class="hljs-keyword">int</span>&gt; <span class="hljs-title">AccessTheWebAsync</span><span class="hljs-params">()</span>
<span class="hljs-function"><span class="hljs-keyword">async</span> Task&lt;<span class="hljs-keyword">int</span>&gt; <span class="hljs-title">AccessTheWebAsync</span>(<span class="hljs-params"></span>)
</span>{

@@ -24,0 +24,0 @@ <span class="hljs-comment">// ...</span>

Non code
<pre><code class="hljs"><span class="hljs-built_in">local</span> <span class="hljs-built_in">var</span> <span class="hljs-subst">=</span> <span class="hljs-string">"untyped code"</span></code></pre>
<pre><code class="hljs"><span class="hljs-keyword">local</span> <span class="hljs-keyword">var</span> = <span class="hljs-string">"untyped code"</span></code></pre>

@@ -5,0 +5,0 @@ <pre><code class="hljs js"><span class="hljs-keyword">var</span> t = <span class="hljs-string">'typed code'</span></code></pre>

@@ -9,2 +9,12 @@ /* jshint mocha: true */

describe('metalsmith-metallic', function(){
it('should set file contents as a buffer', function(done){
Metalsmith('test/fixture')
.use(metallic())
.build(function(err, files){
if (err) { return done(err); }
assert.strictEqual(files['index.md'].contents instanceof Buffer, true);
done();
});
});
it('should highlight code blocks in markdown files', function(done){

@@ -19,3 +29,3 @@ fs.readFile('test/fixture/expected/index.md', 'utf8', function (err,data) {

if (err) { return done(err); }
assert.equal(data.toString(), files['index.md'].contents);
assert.equal(data.toString(), files['index.md'].contents.toString());
done();

@@ -25,3 +35,3 @@ });

});
it('should parse code blocks with the no-highlight language in markdown files', function(done){

@@ -36,3 +46,3 @@ fs.readFile('test/fixture/expected/nohighlight.md', 'utf8', function (err,data) {

if (err) { return done(err); }
assert.equal(data.toString(), files['nohighlight.md'].contents);
assert.equal(data.toString(), files['nohighlight.md'].contents.toString());
done();

@@ -42,3 +52,3 @@ });

});
it('should highlight specific languages as it does in the browser', function(done){

@@ -53,7 +63,7 @@ fs.readFile('test/fixture/expected/csharp.md', 'utf8', function (err,data) {

if (err) { return done(err); }
assert.equal(data.toString(), files['csharp.md'].contents);
assert.equal(data.toString(), files['csharp.md'].contents.toString());
done();
});
});
});
});
});

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