Changeset 3597 for lang/javascript/blosxom.rhino
- Timestamp:
- 12/26/07 13:28:26 (5 years ago)
- Location:
- lang/javascript/blosxom.rhino
- Files:
-
- 2 modified
-
ejs.js (modified) (4 diffs)
-
template.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/blosxom.rhino/ejs.js
r3131 r3597 1 1 #!rhino 2 2 3 EJS = function (template) { this.initialize(template) };3 EJS = function (template) { return (this instanceof EJS) ? this.initialize(template) : new EJS(template) }; 4 4 EJS.prototype = { 5 5 initialize : function (template) { … … 21 21 22 22 var m, c; 23 while (m = s.match(/<%( [^\s]*)/)) {23 while (m = s.match(/<%(=*)/)) { 24 24 var flag = m[1]; 25 25 ret.push('ret.push(', uneval(s.slice(0, m.index)), ');'); … … 33 33 ret.push('ret.push(EJS.escape(', c,'));'); 34 34 break; 35 case "= R":35 case "===": 36 36 ret.push('ret.push(', c,');'); 37 37 break; … … 47 47 } 48 48 }; 49 EJS.escapeMap ={ "&" : "&", "<" : "<" , ">" : ">"}; 49 50 EJS.escape = function (str) { 50 var map = { "&" : "&", "<" : "<" , ">" : ">"};51 51 return str.replace(/[&<>]/g, function (m) { 52 return map[m];52 return EJS.escapeMap[m]; 53 53 }); 54 54 }; 55 56 //var t = EJS("aaaa<%=foo%>bbbbb<%=bar%>ccc"); 57 // 58 //print(t.processor); 59 //print(t.run({foo:"test", bar:"foobar"})); 55 60 56 61 /* -
lang/javascript/blosxom.rhino/template.html
r3048 r3597 146 146 </h3> 147 147 <div class="entry-content"> 148 <%= Rentry.body %>148 <%=== entry.body %> 149 149 </div> 150 150 <dl class="information">
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)