Change some PDoc characters to HTML entities so that we don't confuse Sprockets.

This commit is contained in:
Andrew Dupont 2009-03-07 15:44:50 -06:00
parent 0f5c9bfcc5
commit deb3df525e
1 changed files with 4 additions and 6 deletions

View File

@ -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.
*
*
*
* <h4>Custom syntaxes</h4>
*
* 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 `<&#38;= %>`
* constructs:
*
* // matches symbols like '<%= field %>'
* // matches symbols like '<&#38;= field %>'
* var syntax = /(^|.|\r|\n)(\<%=\s*(\w+)\s*%\>)/;
*
* var t = new Template(
* '<div>Name: <b><%= name %></b>, Age: <b><%=age%></b></div>', syntax);
* '<div>Name: <b><&#38;= name %></b>, Age: <b><&#38;=age%></b></div>',
* syntax);
* t.evaluate( {name: 'John Smith', age: 26} );
* // -> <div>Name: <b>John Smith</b>, Age: <b>26</b></div>
*