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

amazeui-doc-util

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazeui-doc-util - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

lib/safeString.js

10

gulpfile.js
'use strict';
var format = require('util').format;
var gulp = require('gulp');

@@ -7,2 +8,3 @@ var $ = require('gulp-load-plugins')();

var docUtil = require('./index');
var pkg = require('./package.json');

@@ -26,3 +28,3 @@ var AUTOPREFIXER_BROWSERS = [

var headerTpl = '/*! Build on <%= date %> */\n';
var headerTpl = format('/*! %s v%s | built on <%= date %> */\n', pkg.name, pkg.version);

@@ -52,8 +54,6 @@ gulp.task('less', function() {

gulp.task('test', function(){
return gulp.src('./test/test.md')
return gulp.src('./test/*.md')
.pipe(markJSON(docUtil.markedOptions))
.pipe(docUtil.applyTemplate())
.pipe($.rename(function(file) {
file.extname = '.html';
}))
.pipe($.rename({extname: '.html'}))
.pipe(gulp.dest('./dist'));

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

@@ -10,3 +10,4 @@ 'use strict';

var Handlebars = require('handlebars');
var _ = require('lodash');
var assign = require('object.assign');
var safeString = require('./safeString');

@@ -114,3 +115,3 @@ var escape = function(html, encode) {

renderer.heading = function(text, level) {
var escapedText = encodeURIComponent(text);
var escapedText = safeString(text);

@@ -125,2 +126,6 @@ return '<h' + level + '><a name="' +

renderer.table = function(header, body) {
return format('<table class="am-table am-table-bordered am-table-striped"><thead>%s</thead><tbody>%s</tbody></table>', header, body);
};
var applyTemplate = function(tpl, data) {

@@ -132,3 +137,3 @@ tpl = tpl || fs.readFileSync(path.join(__dirname, '../template/default.hbs'),

return through.obj(function (file, enc, callback) {
var mdData = _.extend({}, JSON.parse(file.contents.toString()), data || {});
var mdData = assign({}, JSON.parse(file.contents.toString()), data || {});
file.contents = new Buffer(compiler(mdData), 'utf8');

@@ -167,1 +172,3 @@ this.push(file);

];
exports.safeString = safeString;
{
"name": "amazeui-doc-util",
"version": "0.2.0",
"version": "0.3.0",
"description": "Amaze UI Markdown docs parsing util.",

@@ -25,7 +25,8 @@ "main": "index.js",

"dependencies": {
"handlebars": "^2.0.0",
"handlebars": "^3.0.3",
"highlight.js": "^8.4.0",
"lodash": "^2.4.1",
"marked": "^0.3.2",
"through2": "^0.6.3"
"object.assign": "^3.0.0",
"through2": "^0.6.3",
"unidecode": "^0.1.7"
},

@@ -32,0 +33,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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