colors-tmpl
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -27,3 +27,3 @@ /*! | ||
, translators = types.map(function (type) { | ||
var re = new RegExp('\\{' + type + '\\}(.*)\\{/' + type + '\\}') | ||
var re = new RegExp('\\{' + type + '\\}(.*?)\\{/' + type + '\\}', 'g') | ||
return function (str) { | ||
@@ -41,2 +41,2 @@ return str.replace(re, '$1'[type]) | ||
module.exports.render = render | ||
module.exports.render = render |
@@ -8,3 +8,3 @@ { | ||
, "description": "Simple templating for applying colors.js to strings" | ||
, "version": "0.0.1" | ||
, "version": "0.0.2" | ||
, "homepage": "https://github.com/rvagg/colors-tmpl" | ||
@@ -23,2 +23,2 @@ , "keywords": [ "color", "colour", "colours", "colours", "colors.js", "templating", "templates" ] | ||
} | ||
} | ||
} |
16
test.js
@@ -100,1 +100,17 @@ #!/usr/bin/env node | ||
) | ||
assert( | ||
colorsTmpl.render( | ||
'{red}red1{/red}, {red}red2{/red}, {red}red3{/red}' | ||
) | ||
, 'red1'.red + ', ' + 'red2'.red + ', ' + 'red3'.red | ||
, 'multiple occurances of a tag in a single string' | ||
) | ||
assert( | ||
colorsTmpl.render( | ||
'\n{red}red1{/red}\n{red}red2{/red}\n{red}red3{/red}\n' | ||
) | ||
, '\n' + 'red1'.red + '\n' + 'red2'.red + '\n' + 'red3'.red + '\n' | ||
, 'multi-line strings' | ||
) |
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
6511
135