Socket
Socket
Sign inDemoInstall

pug

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug - npm Package Compare versions

Comparing version 2.0.0-beta9 to 2.0.0-rc.1

test/cases/attrs.colon.html

10

package.json
{
"name": "pug",
"description": "A clean, whitespace-sensitive template language for writing HTML",
"version": "2.0.0-beta9",
"version": "2.0.0-rc.1",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -24,6 +24,6 @@ "maintainers": [

"pug-code-gen": "^1.1.1",
"pug-filters": "^2.1.0",
"pug-lexer": "^2.3.1",
"pug-linker": "^2.0.1",
"pug-load": "^2.0.4",
"pug-filters": "^2.1.2",
"pug-lexer": "^3.1.0",
"pug-linker": "^3.0.0",
"pug-load": "^2.0.6",
"pug-parser": "^2.0.2",

@@ -30,0 +30,0 @@ "pug-runtime": "^2.0.3",

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -12,4 +12,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -16,0 +16,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -12,4 +12,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -16,0 +16,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function template(locals) {
var pug_html = "", pug_mixins = {}, pug_interp;
pug_html = pug_html + '<script type="text/javascript">(function() {\n var regexp;\n\n regexp = /\\n/;\n\n}).call(this);\n(function(){var n;n={square:function(n){return n*n}}}).call(this);</script>';
pug_html = pug_html + '<script type="text/javascript">(function() {\n var regexp;\n\n regexp = /\\n/;\n\n}).call(this);\n(function(){}).call(this);</script>';
return pug_html;
}
function template(locals) {
var pug_html = "", pug_mixins = {}, pug_interp;
pug_html = pug_html + "<html><body><p>Just <em>some</em> markdown <strong>tests</strong>.</p>\n<p>With new line.</p>\n<script>(function(){var n;n={square:function(n){return n*n}}}).call(this);</script><script>(function() {\n var math;\n\n math = {\n square: function(value) {\n return value * value;\n }\n };\n\n}).call(this);\n</script></body></html>";
pug_html = pug_html + "<html><body><p>Just <em>some</em> markdown <strong>tests</strong>.</p>\n<p>With new line.</p>\n<script>(function(){}).call(this);</script><script>(function() {\n var math;\n\n math = {\n square: function(value) {\n return value * value;\n }\n };\n\n}).call(this);\n</script></body></html>";
return pug_html;
}
function template(locals) {
var pug_html = "", pug_mixins = {}, pug_interp;
pug_html = pug_html + '<script><![CDATA[!function(){console.log("test")}();]]></script><script><![CDATA[(function(){!function(){return console.log("test")}()}).call(this);]]></script>';
pug_html = pug_html + '<script><![CDATA[!function(){console.log("test")}();]]></script><script><![CDATA[(function(){!function(){console.log("test")}()}).call(this);]]></script>';
return pug_html;
}
function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -5,0 +5,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -25,4 +25,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -29,0 +29,0 @@ }

function template(locals) {
var pug_html = "", pug_mixins = {}, pug_interp;
pug_html = pug_html + '<option value="">-- (selected) --</option><p></p><p></p><p>foo\nbar\nbaz</p><p>foo\n\n\nbar\nbaz\n</p>foo\n\n\nbar\nbaz\n<pre>foo\n bar\n baz\n.</pre><pre>foo\n bar\n baz\n.\n</pre>foo\n bar\n baz\n.';
pug_html = pug_html + '<option value="">-- (selected) --</option><p></p><p></p><p>foo\nbar\n\n\nbaz</p><p>foo\n\n\nbar\nbaz\n</p>foo\n\n\nbar\nbaz\n<pre>foo\n bar\n baz\n.</pre><pre>foo\n bar\n baz\n.\n</pre>foo\n bar\n baz\n.';
return pug_html;
}
function pug_attr(t, e, n, f) {
return e !== !1 && null != e && (e || "class" !== t && "style" !== t) ? e === !0 ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || e.indexOf('"') === -1) ? (n && (e = pug_escape(e)),
return !1 !== e && null != e && (e || "class" !== t && "style" !== t) ? !0 === e ? " " + (f ? t : t + '="' + t + '"') : ("function" == typeof e.toJSON && (e = e.toJSON()),
"string" == typeof e || (e = JSON.stringify(e), n || -1 === e.indexOf('"')) ? (n && (e = pug_escape(e)),
" " + t + '="' + e + '"') : " " + t + "='" + e.replace(/'/g, "&#39;") + "'") : "";

@@ -12,4 +12,4 @@ }

function pug_classes_array(r, a) {
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) s = pug_classes(r[g]),
s && (c && a[g] && (s = pug_escape(s)), e = e + u + s, u = " ");
for (var s, e = "", u = "", c = Array.isArray(a), g = 0; g < r.length; g++) (s = pug_classes(r[g])) && (c && a[g] && (s = pug_escape(s)),
e = e + u + s, u = " ");
return e;

@@ -16,0 +16,0 @@ }

@@ -12,3 +12,3 @@ const assert = require('assert');

it(name, function(){
var path = __dirname + '/anti-cases/' + test + '.pug';
var path = __dirname.replace(/\\/g, '/') + '/anti-cases/' + test + '.pug';
var str = fs.readFileSync(path, 'utf8');

@@ -15,0 +15,0 @@ try {

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

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

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