Socket
Socket
Sign inDemoInstall

marked-brunch-static

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked-brunch-static - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

56

index.js

@@ -10,37 +10,41 @@ var MarkedBrunchStatic, _, marked;

MarkedBrunchStatic = (function() {
function MarkedBrunchStatic(config1) {
var ref, ref1;
this.config = config1;
if ((ref = this.config) != null ? ref.fileMatch : void 0) {
this.handles = this.config.fileMatch;
delete this.config.fileMatch;
class MarkedBrunchStatic {
constructor(config1) {
var ref, ref1;
this.config = config1;
if ((ref = this.config) != null ? ref.fileMatch : void 0) {
this.handles = this.config.fileMatch;
delete this.config.fileMatch;
}
if ((ref1 = this.config) != null ? ref1.fileTransform : void 0) {
this.transformPath = this.config.fileTransform;
delete this.config.fileTransform;
}
}
if ((ref1 = this.config) != null ? ref1.fileTransform : void 0) {
this.transformPath = this.config.fileTransform;
delete this.config.fileTransform;
transformPath(filename) {
return filename.replace(/\.static\.\w+$/, '.html');
}
}
MarkedBrunchStatic.prototype.handles = /\.static\.(?:markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text)$/;
compile(data, filename, options, callback) {
var opts;
opts = _.merge({}, this.config, options != null ? options.markdown : void 0);
return marked(data, opts, function(err, content) {
if (err) {
callback(err);
return;
}
// we need to fix some html-escaping that breaks handlebars
content = content.replace(/\{\{>/g, '{{>');
return callback(null, content);
});
}
MarkedBrunchStatic.prototype.transformPath = function(filename) {
return filename.replace(/\.static\.\w+$/, '.html');
};
MarkedBrunchStatic.prototype.compile = function(data, filename, options, callback) {
var opts;
opts = _.merge({}, this.config, options != null ? options.markdown : void 0);
return marked(data, opts, function(err, content) {
if (err) {
callback(err);
return;
}
content = content.replace(/\{\{>/g, '{{>');
return callback(null, content);
});
};
MarkedBrunchStatic.prototype.handles = /\.static\.(?:markdown|mdown|mkdn|md|mkd|mdwn|mdtxt|mdtext|text)$/;
return MarkedBrunchStatic;
})();
}).call(this);

@@ -47,0 +51,0 @@ module.exports = function(config) {

@@ -11,3 +11,3 @@ {

],
"version": "1.1.0",
"version": "1.1.1",
"homepage": "https://github.com/bmatcuk/marked-brunch-static",

@@ -20,17 +20,13 @@ "license": "MIT",

"scripts": {
"prepublish": "brunch build -P",
"start": "brunch watch",
"test": "mocha"
"prepare": "brunch build -p",
"start": "brunch watch"
},
"dependencies": {
"lodash.merge": "^3.3.2",
"marked": "^0.3.5"
"lodash.merge": "^4.6.1",
"marked": "^0.5.2"
},
"devDependencies": {
"brunch": "^1.8.5",
"chai": "^3.2.0",
"coffee-script-brunch": "^1.8.2",
"javascript-brunch": "^1.7.1",
"mocha": "^2.3.0"
"brunch": "~2.10.17",
"coffee-script-brunch": "~3.0.0"
}
}

@@ -39,2 +39,3 @@ ![Release](https://img.shields.io/npm/v/marked-brunch-static.svg)

fileMatch: ...
fileTransform: ((filename) -> ...)
...

@@ -53,1 +54,5 @@ }

* **fileTransform** _(default: `(filename) -> filename.replace(/\.static\.\w+$/, '.html')`)_
> _fileTransform_ converts the input filename into an html filename. It takes a filename as input and returns the new filename with the html extension. If you set the _fileMatch_ property above, you'll probably need to set this option as well to ensure that your output files end with the html extension.

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