Socket
Socket
Sign inDemoInstall

derby-jade

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derby-jade - npm Package Compare versions

Comparing version 0.6.13 to 0.6.14

test/extra/bem/index.jade

17

index.js

@@ -86,2 +86,3 @@ var jade = require('jade');

var lastScript = Infinity;
var lastElement = null;
var script = [];

@@ -161,2 +162,3 @@ var scripts = [];

var line = lines[i];
var oldLine;
var extendMatch, extendFileName, extendFile, extendTempFileName;

@@ -243,3 +245,9 @@

// BEM-elements
if (indent === 0) {
lastElement = statement.match(/element=['"]([^'"]*)['"]/);
lastElement && (lastElement = lastElement[1])
}
if (indent === 0) {
// Derby tag

@@ -266,2 +274,11 @@ // It means that we are going to start another block,

debugString += ', block';
// BEM replacement
if (lastElement) {
do {
line = line.replace(/(^\s*[\w\.#-]*\.)(&)/, '$1' + lastElement);
oldLine = line
} while (line !== oldLine);
}
block.push(line);

@@ -268,0 +285,0 @@ }

2

package.json
{
"name": "derby-jade",
"description": "Jade for Derby.js",
"version": "0.6.13",
"version": "0.6.14",
"author": {

@@ -6,0 +6,0 @@ "name": "Vladimir Makhaev",

@@ -70,2 +70,10 @@ var assert = require("assert");

it("should support BEM shorthand: compile '&' into element name of component", function() {
dJade(app);
var compiler = app.compilers[".jade"];
var jade = fs.readFileSync(__dirname + "/extra/bem/index.jade", "utf8");
var html = fs.readFileSync(__dirname + "/extra/bem/result.html", "utf8");
assert.equal(compiler(jade, __dirname + "/extra/bem/index.jade"), html);
});
});

Sorry, the diff of this file is not supported yet

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