Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

razorleaf

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

razorleaf - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0

2

package.json
{
"name": "razorleaf",
"version": "0.8.1",
"version": "0.9.0",
"main": "razorleaf.js",

@@ -5,0 +5,0 @@ "files": ["razorleaf.js"],

@@ -442,3 +442,38 @@ "use strict";

function compileStatic(element) {
var isVoid = voidTags.indexOf(element.name) !== -1;
var startTag = "<" + element.name;
var content = "";
for(var i = 0; i < element.children.length; i++) {
var child = element.children[i];
if(child.type === "attribute") {
startTag += " " + child.name + "=\"" + child.value.toAttributeValue() + "\"";
} else if(child.type === "element") {
var staticMarkup = compileStatic(child);
if(staticMarkup === null) {
return null;
}
content += staticMarkup;
} else if(child.type === "string") {
content += child.content.toContent();
} else {
return null;
}
}
if(isVoid) {
if(content) {
throw new SyntaxError("Void element " + element.name + " cannot contain elements."); // TODO: Where‽
}
return startTag + ">";
}
return startTag + ">" + content + "</" + element.name + ">";
}
function compileChildren(children) {

@@ -459,2 +494,9 @@ var info = {attributes: false, content: false};

info.content = true;
var staticMarkup = compileStatic(child);
if(staticMarkup !== null) {
return "__top.content += '" + staticMarkup + "';";
}
var isVoid = voidTags.indexOf(child.name) !== -1;

@@ -461,0 +503,0 @@ var children = compileChildren(child.children);

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