Permalink
Browse files

s/\s+$//

  • Loading branch information...
1 parent 52fe7dd commit 840b901384904cc09c6e2f3db3de367a91ce4e2b @Floby committed Aug 26, 2011
Showing with 9 additions and 9 deletions.
  1. +2 −2 README.md
  2. +2 −2 lib/compile.js
  3. +4 −4 lib/template.js
  4. +1 −1 package.json
View
4 README.md
@@ -48,8 +48,8 @@ the Template class follow more or less the Readable Stream interface (I plan on
The template syntax is inspired by JSP. you can include javascript code in the middle of your
file if you put `<%` and `%>` around. by default the `print()` and `include()` function are available
-from the template. Others may be available depending on the sandboxing behaviour. `print(data)` will
-write `data` out and `include('filename')` will process `filename` as a template and insert the
+from the template. Others may be available depending on the sandboxing behaviour. `print(data)` will
+write `data` out and `include('filename')` will process `filename` as a template and insert the
result where the call was made. `filename` can be a relative or absolute path.
* `<%= {expression} %>` is a shortcut for print({expression}).
View
4 lib/compile.js
@@ -74,7 +74,7 @@ function compile_template(template) {
}
current = end;
if(finished) throw new FinishedTemplate();
- }
+ }
function getSource() {
// the +2 is for ignoring the <%
var begin = current + 2,
@@ -108,7 +108,7 @@ function compile_template(template) {
//module.exports = process_template;
module.exports = compile_template;
-compile_template._filters = {};
+compile_template._filters = {};
compile_template.registerFilter = function(name, func) {
//console.log(typeof(func));
if(!/^[a-z0-9A-Z_]+$/.test(name))
View
8 lib/template.js
@@ -42,7 +42,7 @@ function make_print(tpl) {
function make_include(tpl) {
return function(filename) {
- if(filename[0] !== '/')
+ if(filename[0] !== '/')
filename = path.normalize(tpl._directory + '/' + filename);
// create a new template
@@ -99,7 +99,7 @@ Template.prototype.run = function run() {
self.emit('error', e);
return false;
}
- var f = self._sandbox ? script.runInNewContext(self._sandbox)
+ var f = self._sandbox ? script.runInNewContext(self._sandbox)
: script.runInThisContext();
/**
* this function is called whenever 'print' is
@@ -128,14 +128,14 @@ Template.prototype._newData = function _newData(logme) {
this._write(this._buffers[0].getData());
this._buffers.shift();
}
-
+
// flush as much as possible from the
// head buffer
if(this._buffers[0] && !this._buffers[0].isEmpty()) {
this._write(this._buffers[0].getData());
this._buffers[0].flush();
}
-
+
// if there is no more data to be flushed
// then we're done =]
if(this._buffers.length == 0 && this._finished) {
View
2 package.json
@@ -15,7 +15,7 @@
"type": "git",
"url": "http://github.com/Floby/node-blue.git"
},
-
+
"engines": {
"node": ">= 0.2.2"
}

0 comments on commit 840b901

Please sign in to comment.