htmltemplate-transform
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "htmltemplate-transform", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Pluggable transforms for HTML::Template", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var assert = require('assert'); | ||
var assign = require('object-assign'); | ||
var NON_WHITESPACE = /\S/; | ||
module.exports = function(options) { | ||
@@ -160,2 +162,8 @@ var loops = options.loopTags; | ||
// Don't guard non-meaningful content, e.g. whitespace | ||
// and comments. | ||
if (skippableContent.every(isWhitespaceOrComment)) { | ||
return content.slice(0, continuation.index); | ||
} | ||
return content | ||
@@ -242,1 +250,11 @@ .slice(0, continuation.index) | ||
} | ||
function isWhitespaceOrComment(node) { | ||
return ( | ||
node.type === 'Comment' || | ||
( | ||
node.type === 'Text' && | ||
!NON_WHITESPACE.test(node.content) | ||
) | ||
); | ||
} |
@@ -258,45 +258,2 @@ [ | ||
} | ||
}, | ||
{ | ||
"type": "Condition", | ||
"name": "TMPL_UNLESS", | ||
"conditions": [ | ||
{ | ||
"type": "ConditionBranch", | ||
"condition": { | ||
"type": "Expression", | ||
"content": { | ||
"type": "CallExpression", | ||
"callee": { | ||
"type": "FunctionIdentifier", | ||
"name": "figure_out_in_runtime", | ||
"position": { | ||
"line": 11, | ||
"column": 21 | ||
} | ||
}, | ||
"arguments": [ | ||
{ | ||
"type": "Identifier", | ||
"name": "$b_skippable", | ||
"position": { | ||
"line": 11, | ||
"column": 43 | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"type": "Text", | ||
"content": "\n ", | ||
"position": { | ||
"line": 17, | ||
"column": 19 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
@@ -303,0 +260,0 @@ ], |
@@ -249,36 +249,2 @@ [ | ||
} | ||
}, | ||
{ | ||
"type": "Condition", | ||
"name": "TMPL_UNLESS", | ||
"conditions": [ | ||
{ | ||
"type": "ConditionBranch", | ||
"condition": { | ||
"type": "Expression", | ||
"content": { | ||
"type": "BinaryExpression", | ||
"operator": "&&", | ||
"left": { | ||
"type": "Identifier", | ||
"name": "$b_nested_condition" | ||
}, | ||
"right": { | ||
"type": "Identifier", | ||
"name": "$b_skip" | ||
} | ||
} | ||
}, | ||
"content": [ | ||
{ | ||
"type": "Text", | ||
"content": "\n ", | ||
"position": { | ||
"line": 13, | ||
"column": 19 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
@@ -285,0 +251,0 @@ ], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
262448
6541