Permalink
Browse files

Added increased support for parens within template tags.

For example, though {{if a===b}} is the correct form, you can now also
write: {{if (a===b)}} without causing parsing errors.
Of course you can also call functions: {{if getValue(a)}} as before.
  • Loading branch information...
1 parent 7769e2b commit 3615c8f003805656947044ea4841cf9ed8189a84 @BorisMoore BorisMoore committed Sep 7, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 jquery.tmpl.js
View
@@ -330,6 +330,10 @@
throw "Template command not found: " + type;
}
def = tag._default || [];
+ if ( parens && !/\w$/.test(target)) {
+ target += parens;
+ parens = "";
+ }
if ( target ) {
target = unescape( target );
args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : "");

0 comments on commit 3615c8f

Please sign in to comment.