colors-tmpl
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -27,5 +27,7 @@ /*! | ||
, translators = types.map(function (type) { | ||
var re = new RegExp('\\{' + type + '\\}(.*?)\\{/' + type + '\\}', 'g') | ||
var re = new RegExp('\\{' + type + '\\}([\\s\\S]*?)\\{/' + type + '\\}', 'g') | ||
return function (str) { | ||
return str.replace(re, '$1'[type]) | ||
return str.replace(re, function (_, s) { | ||
return s[type] | ||
}) | ||
} | ||
@@ -32,0 +34,0 @@ }) |
@@ -8,3 +8,3 @@ { | ||
, "description": "Simple templating for applying colors.js to strings" | ||
, "version": "0.0.2" | ||
, "version": "0.0.3" | ||
, "homepage": "https://github.com/rvagg/colors-tmpl" | ||
@@ -11,0 +11,0 @@ , "keywords": [ "color", "colour", "colours", "colours", "colors.js", "templating", "templates" ] |
@@ -116,1 +116,9 @@ #!/usr/bin/env node | ||
) | ||
assert( | ||
colorsTmpl.render( | ||
'\n{red}red1\nred2\nred3{/red}\n' | ||
) | ||
, '\n' + 'red1\nred2\nred3'.red + '\n' | ||
, 'tags can surround 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
6724
144