From deb3df525e9f6d9e7ab311e0a93e48a6ad51be63 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Sat, 7 Mar 2009 15:44:50 -0600 Subject: [PATCH] Change some PDoc characters to HTML entities so that we don't confuse Sprockets. --- src/lang/template.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lang/template.js b/src/lang/template.js index 5d06e3d..83d7ab3 100644 --- a/src/lang/template.js +++ b/src/lang/template.js @@ -18,7 +18,6 @@ * in the form (e.g., `#{fieldName}`) that will be replaced by actual values * when the template is applied (evaluated) to an object. * - * * // the template (our formatting expression) * var myTemplate = new Template( * 'The TV show #{title} was created by #{author}.'); @@ -74,8 +73,6 @@ * t.evaluate(data); * // -> in Ruby we also use the #{variable} syntax for templates. * - * - * *

Custom syntaxes

* * The default syntax of the template strings will probably be enough for most @@ -83,14 +80,15 @@ * 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 ubiquitous `<&= %>` * constructs: * - * // matches symbols like '<%= field %>' + * // matches symbols like '<&= field %>' * var syntax = /(^|.|\r|\n)(\<%=\s*(\w+)\s*%\>)/; * * var t = new Template( - * '
Name: <%= name %>, Age: <%=age%>
', syntax); + * '
Name: <&= name %>, Age: <&=age%>
', + * syntax); * t.evaluate( {name: 'John Smith', age: 26} ); * // ->
Name: John Smith, Age: 26
*