Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cache fixed. compress option fixed.

  • Loading branch information...
commit a28868cb40814ddc5677e9cb2ad2d9c88f23329a 1 parent 436dfe3
@akaspin authored
Showing with 10 additions and 1 deletion.
  1. +3 −0  cache.js
  2. +7 −1 parser.js
View
3  cache.js
@@ -3,6 +3,8 @@
* "dog-pile effect".
*/
+//var sys = require("sys");
+
cache = {};
locks = {};
needFlush = [];
@@ -75,6 +77,7 @@ exports.flush = flush;
// private
function put(key, value) {
+ cache[key] = value;
locks[key].forEach(function(action) {
action(value);
});
View
8 parser.js
@@ -65,7 +65,6 @@ function parseText(source, origin, customOptions, callback) {
if (customOptions) {
options.compress = customOptions.compress != false ? true : false;
-
if (customOptions.filters) {
for (var i in customOptions.filters)
options.filters[i] = customOptions.filters[i];
@@ -330,6 +329,13 @@ function tokenize(source, options, callback) {
return text.replace(arguments.callee.sRE, '\\$1');
};
+ if(options.compress) {
+ source = source.
+ replace(/ */g, ' ')
+ .replace(/\n /g, '\n')
+ .replace(/\n\n*/g, '\n');
+ }
+
var tokenRe;
var opRe;
var opsSig = {
Please sign in to comment.
Something went wrong with that request. Please try again.