ejs-html
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -0,1 +1,4 @@ | ||
# 4.0.2 | ||
* Fixed: compiling custom elements inside custom elements with `compileDebug` set to `false` would crash on runtime. The fix on 4.0.1 did not covered the recursive case. | ||
# 4.0.1 | ||
@@ -2,0 +5,0 @@ * Fixed: compiling custom elements with `compileDebug` set to `false` would crash on runtime |
@@ -49,3 +49,3 @@ 'use strict' | ||
contents.forEach((tokens, name) => { | ||
let content = compile.createCode(reduce(tokens)) | ||
let content = compile.createCode(reduce(tokens, compileDebug), compileDebug) | ||
jsCode += `\n\t\t"${jsEscape(name)}": (function () {\n${content}})(),` | ||
@@ -101,8 +101,9 @@ }) | ||
* @param {Token} element | ||
* @param {boolean} compileDebug | ||
* @returns {Token} - an ejs-raw token | ||
*/ | ||
module.exports.preparePlaceholder = function (element) { | ||
module.exports.preparePlaceholder = function (element, compileDebug) { | ||
let name = getNameAttributeValue(element), | ||
escapedName = jsEscape(name), | ||
content = compile.createCode(reduce(element.children)) | ||
content = compile.createCode(reduce(element.children, compileDebug), compileDebug) | ||
return { | ||
@@ -109,0 +110,0 @@ type: 'ejs-raw', |
@@ -44,3 +44,3 @@ 'use strict' | ||
* @property {?string} content - present for types: text, ejs-eval, ejs-escaped, ejs-raw, comment, doctype | ||
* @property {?string} name - present for types: element | ||
* @property {?string} name - present for type: element | ||
* @property {?boolean} isVoid - whether this is a void element, present for type: element | ||
@@ -47,0 +47,0 @@ * @property {?Array<Attribute>} attributes - present for type: element |
@@ -54,3 +54,3 @@ 'use strict' | ||
// Custom element content placeholder | ||
newTokens.push(custom.preparePlaceholder(token)) | ||
newTokens.push(custom.preparePlaceholder(token, compileDebug)) | ||
continue | ||
@@ -57,0 +57,0 @@ } else if (token.name.includes('-')) { |
{ | ||
"name": "ejs-html", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"author": "Sitegui <sitegui@sitegui.com.br>", | ||
@@ -5,0 +5,0 @@ "description": "Embedded JavaScript HTML templates. An implementation of EJS focused on run-time performance, HTML syntax checking, minified HTML output and custom HTML elements.", |
47284
956