From 6c1790ac4e6a857742e8fdc761e6305a14c79a17 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Tue, 29 Dec 2009 01:54:56 +0100 Subject: [PATCH] doc: Fix Template doc to avoid issues with Sprockets. --- src/lang/template.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lang/template.js b/src/lang/template.js index fce8476..f9773f5 100644 --- a/src/lang/template.js +++ b/src/lang/template.js @@ -82,14 +82,14 @@ * inadequate, there's a provision for customization. `Template`'s * constructor accepts an optional second argument that is a regular expression * object to match the replaceable symbols in the template string. Let's put - * together a template that uses a syntax similar to the ubiquitous `<%= %>` + * together a template that uses a syntax similar to the now ubiquitous `{{ }}` * constructs: * - * // matches symbols like '<%= field %>' - * var syntax = /(^|.|\r|\n)(\<%=\s*(\w+)\s*%\>)/; + * // matches symbols like '{{ field }}' + * var syntax = /(^|.|\r|\n)(\{{\s*(\w+)\s*}})/; * * var t = new Template( - * '
Name: <%= name %>, Age: <%= age %>
', + * '
Name: {{ name }}, Age: {{ age }}
', * syntax); * t.evaluate( {name: 'John Smith', age: 26} ); * // ->
Name: John Smith, Age: 26