Change some PDoc characters to HTML entities so that we don't confuse Sprockets.
This commit is contained in:
parent
0f5c9bfcc5
commit
deb3df525e
|
@ -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 `<&= %>`
|
||||
* constructs:
|
||||
*
|
||||
* // matches symbols like '<%= field %>'
|
||||
* // matches symbols like '<&= 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><&= name %></b>, Age: <b><&=age%></b></div>',
|
||||
* syntax);
|
||||
* t.evaluate( {name: 'John Smith', age: 26} );
|
||||
* // -> <div>Name: <b>John Smith</b>, Age: <b>26</b></div>
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue