Socket
Socket
Sign inDemoInstall

ssi

Package Overview
Dependencies
12
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.5 to 0.2.0

test/testLoosenedSpace.js

4

index.js

@@ -7,4 +7,4 @@

var ssi = function(inputDirectory, outputDirectory, matcher) {
this.parser = new SSI(inputDirectory, outputDirectory, matcher);
var ssi = function(inputDirectory, outputDirectory, matcher, loosenedSpace) {
this.parser = new SSI(inputDirectory, outputDirectory, matcher, loosenedSpace);
};

@@ -11,0 +11,0 @@

@@ -6,3 +6,2 @@

var DIRECTIVE_MATCHER = /<!--#([a-z]+)([ ]+([a-z]+)="(.+?)")* -->/g;
var ATTRIBUTE_MATCHER = /([a-z]+)="(.+?)"/g;

@@ -30,3 +29,3 @@ var INTERPOLATION_MATCHER = /\$\{(.+?)\}/g;

var DirectiveHandler = function(ioUtils) {
var DirectiveHandler = function(ioUtils, directiveRegex) {
this.parser = undefined;

@@ -36,2 +35,3 @@ this.ioUtils = ioUtils;

this.currentConditional = undefined;
this.directiveRegex = directiveRegex;
};

@@ -260,3 +260,3 @@

if (this._parseExpression(conditional.getExpression()).truthy) {
var directiveHandler = new DirectiveHandler(this.ioUtils);
var directiveHandler = new DirectiveHandler(this.ioUtils, this.directiveRegex);
var output = {output: "", variables: {}};

@@ -269,3 +269,3 @@

//noinspection JSValidateTypes
var directiveName = new RegExp(DIRECTIVE_MATCHER).exec(directive)[1];
var directiveName = new RegExp(this.directiveRegex).exec(directive)[1];

@@ -272,0 +272,0 @@ var results = directiveHandler.handleDirective(directive, directiveName, currentFile,

@@ -8,8 +8,6 @@

var DIRECTIVE_MATCHER = /<!--#([a-z]+)([ ]+([a-z]+)="(.+?)")* -->/g;
(function() {
"use strict";
var ssi = function(inputDirectory, outputDirectory, matcher) {
var ssi = function(inputDirectory, outputDirectory, matcher, loosenedSpace) {
this.inputDirectory = inputDirectory;

@@ -20,4 +18,6 @@ this.documentRoot = inputDirectory;

this.directiveRegex = loosenedSpace ? /<!--[ ]*#([a-z]+)([ ]+([a-z]+)="(.+?)")*[ ]*-->/g : /<!--#([a-z]+)([ ]+([a-z]+)="(.+?)")* -->/g;
this.ioUtils = new IOUtils(this.documentRoot);
this.directiveHandler = new DirectiveHandler(this.ioUtils);
this.directiveHandler = new DirectiveHandler(this.ioUtils, this.directiveRegex);
this.directiveHandler.parser = this;

@@ -45,3 +45,3 @@ };

contents = contents.replace(new RegExp(DIRECTIVE_MATCHER), function(directive, directiveName) {
contents = contents.replace(new RegExp(instance.directiveRegex), function(directive, directiveName) {
var data = instance.directiveHandler.handleDirective(directive, directiveName, filename, variables);

@@ -68,2 +68,1 @@

})();
{
"name": "ssi",
"version": "0.1.5",
"version": "0.2.0",
"description": "Server Side Includes for NodeJS",
"author": "Glenn Nelson <glenn@hexcoder.us> (glenn@hexcoder.us)",
"author": "Chen-Heng Chang <wandererm@gmail.com> (http://kidwm.net/)",
"main": "index.js",

@@ -13,17 +13,15 @@ "keywords": [

"type": "git",
"url": "https://github.com/67726e/node-ssi.git"
"url": "https://github.com/kidwm/node-ssi.git"
},
"license": "MIT",
"readmeFilename": "README.md",
"gitHead": "d99f35decc10fbcd2406b2bb7ee23e80b6f23661",
"dependencies": {
"mkdirp": "~0.3.5",
"glob": "~3.2.1"
"glob": "^6.0.1",
"mkdirp": "^0.5.1"
},
"devDependencies": {
"mocha": "~1.10.0"
"mocha": "^2.3.4"
},
"scripts": {
"test": "mocha"
"test": "mocha"
}
}
node-ssi
========
[![Build Status](https://travis-ci.org/67726e/node-ssi.png)](https://travis-ci.org/67726e/node-ssi)
[![Build Status](https://travis-ci.org/kidwm/node-ssi.png)](https://travis-ci.org/kidwm/node-ssi)

@@ -27,3 +27,3 @@ Server Side Includes for NodeJS

```bash
npm install ssi
npm install ssi
```

@@ -44,2 +44,4 @@

If you want to support loosened spaces in directive like `<!-- #include file="" -->` or `<!-- #include file="" -->`, just enable the fourth argument: `new ssi(inputDirectory, outputDirectory, matcher, true)`.
### Methods

@@ -61,2 +63,1 @@

MIT

@@ -7,3 +7,3 @@

describe("", function() {
describe("Nested", function() {
"use strict";

@@ -13,3 +13,3 @@

it("", function() {
it("netsted folder", function() {
var filename = "test/html/nested-parent.html";

@@ -16,0 +16,0 @@ var contents = fs.readFileSync(filename, {encoding: "utf8"});

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc