Skip to content

Commit

Permalink
Fixing a parsing regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
borgar committed Apr 17, 2010
1 parent ca52dc2 commit d6c9744
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"_.index=$i||0;",
"with($data){" // Introduce the data as local variables using with(){}
];
while ( m = str.match( /^(.*?){{\s*(\/?)(\w+|\S)(?:\((.*?)\))?(?: (.*?))?\s*}}/ ) ) {
while ( m = str.match( /^([\s\S]*?){{\s*(\/?)(\w+|\S)(?:\((.*?)\))?(?: (.*?))?\s*}}/ ) ) {

// have prefix before tag
if ( m[1] ) {
Expand Down
2 changes: 2 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
test_handler( "returns do not kill tags", R('{{\r= \r\none\r\n }}',O), 'first');
test_handler( "returns in strings don't kill tags", R('{{= "on\re" }}',O), 'on\re' );
test_handler( "slashes in strings don't kill tags", R('{{= "on\\e" }}',O), 'on\\e');
test_handler( "newlines don't kill parsing", R('a\nb\nc{{= 8 }}.'), 'a\nb\nc8.');

// TODO: this is the data object (contexts)

jQuery.getText = function ( str ) { return str.toUpperCase(); };
Expand Down

0 comments on commit d6c9744

Please sign in to comment.