template variables with spaces are not replaced correctly fixed #129

This commit is contained in:
javi 2014-02-06 17:33:26 +01:00
parent ab7d603171
commit 78f69d5236
3 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,10 @@ Enhancements:
* Allow specifying fixed sqlapi host address (#117) * Allow specifying fixed sqlapi host address (#117)
Bug fixes:
* Template variables with spaces are not replaced correctly (#129)
1.6.3 -- 2014-01-30 1.6.3 -- 2014-01-30
------------------- -------------------

View File

@ -534,7 +534,7 @@ o._replaceVars = function(str, params) {
if ( ! params._re ) { if ( ! params._re ) {
params._re = {}; params._re = {};
for (var k in params) { for (var k in params) {
params._re[k] = RegExp("<%= " + k + " %>", "g"); params._re[k] = RegExp("<%=\\s*" + k + "\\s*%>", "g");
} }
} }
for (var k in params) str = str.replace(params._re[k], params[k]); for (var k in params) str = str.replace(params._re[k], params[k]);