remarkable-loader
Advanced tools
Comparing version 0.2.0 to 0.2.1
28
index.js
@@ -1,18 +0,18 @@ | ||
var Remarkable = require('remarkable'); | ||
var hljs = require('highlight.js'); | ||
var Remarkable = require('remarkable') | ||
var hljs = require('highlight.js') | ||
var extend = function (obj, source) { | ||
var prop; | ||
var prop | ||
for (prop in source) { | ||
if (source.hasOwnProperty(prop)) { | ||
obj[prop] = source[prop]; | ||
obj[prop] = source[prop] | ||
} | ||
} | ||
return obj; | ||
}; | ||
return obj | ||
} | ||
module.exports = function (source) { | ||
this.cacheable(); | ||
this.cacheable() | ||
@@ -24,3 +24,3 @@ var opts = extend({ | ||
try { | ||
return hljs.highlight(lang, str).value; | ||
return hljs.highlight(lang, str).value | ||
} catch (err) {} | ||
@@ -30,12 +30,12 @@ } | ||
try { | ||
return hljs.highlightAuto(str).value; | ||
return hljs.highlightAuto(str).value | ||
} catch (err) {} | ||
return ''; | ||
return '' | ||
} | ||
}, this.options.remarkable); | ||
}, this.options.remarkable) | ||
var parser = new Remarkable(opts.preset, opts); | ||
var parser = new Remarkable(opts.preset, opts) | ||
return parser.render(source); | ||
}; | ||
return parser.render(source) | ||
} |
{ | ||
"name": "remarkable-loader", | ||
"description": "Parse source as Markdown.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": { | ||
@@ -20,2 +20,3 @@ "name": "Daniel Perez Alvarez", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "./node_modules/.bin/nodeunit test/loader.js" | ||
@@ -28,5 +29,9 @@ }, | ||
"devDependencies": { | ||
"nodeunit": "^0.9", | ||
"cheerio": "^0.20.0" | ||
"cheerio": "^0.20.0", | ||
"eslint": "^3.0.0", | ||
"eslint-config-standard": "^5.1.0", | ||
"eslint-plugin-promise": "^1.0.8", | ||
"eslint-plugin-standard": "^1.3.2", | ||
"nodeunit": "^0.9.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4361
6
7