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.9.1 to 0.9.2

2

package.json
{
"name": "razorleaf",
"version": "0.9.1",
"version": "0.9.2",
"main": "razorleaf.js",

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

@@ -23,7 +23,22 @@ "use strict";

function InterpolatedString(parts) {
function InterpolatedString(parts, unescaped) {
this.parts = parts;
this.unescaped = unescaped;
}
InterpolatedString.prototype.toUnescapedContent = function() {
return this.parts.map(function(part) {
if(typeof part === "string") {
return part;
}
return "' + (" + part.expression + "\n) + '";
}).join("");
};
InterpolatedString.prototype.toAttributeValue = function() {
if(this.unescaped) {
return this.toUnescapedContent();
}
return this.parts.map(function(part) {

@@ -39,2 +54,6 @@ if(typeof part === "string") {

InterpolatedString.prototype.toContent = function() {
if(this.unescaped) {
return this.toUnescapedContent();
}
return this.parts.map(function(part) {

@@ -172,2 +191,3 @@ if(typeof part === "string") {

return this.reading(function() {
var unescaped = !!this.readExact("!");
var quote = this.read();

@@ -220,3 +240,3 @@

type: "string",
content: new InterpolatedString(parts)
content: new InterpolatedString(parts, unescaped)
};

@@ -223,0 +243,0 @@ });

@@ -32,2 +32,4 @@ Razor Leaf is a template engine for HTML. It is indentation-based and vaguely

' of Razor Leaf’s features.'
!'Literal <abbr title="HyperText Markup Language">HTML</abbr> content can be written using a string with a leading exclamation mark.'
```

@@ -74,3 +76,4 @@

be escaped, but a closing brace (`}`) does. Strings’ contents are escaped as
appropriate.
appropriate. Unescaped strings are marked up with a `!` before the opening
delimiter.

@@ -92,4 +95,3 @@ ### Special blocks

- Replaceable blocks and template extension/inclusion
- Literal (unescaped) strings
[Jade]: http://jade-lang.com/
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