Compiled JavaScript files for improved literal mode.

This commit is contained in:
Marc Häfner
2013-03-15 03:26:12 +01:00
parent 44c2b4aa7f
commit b8d695a4e1
2 changed files with 6 additions and 6 deletions

View File

@@ -99,15 +99,18 @@
};
exports.invertLiterate = function(code) {
var line, lines, match;
var line, lines, maybe_code;
maybe_code = true;
lines = (function() {
var _i, _len, _ref1, _results;
_ref1 = code.split('\n');
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
line = _ref1[_i];
if (match = /^([ ]{4}|\t)/.exec(line)) {
_results.push(line.slice(match[0].length));
if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) {
_results.push(line);
} else if (maybe_code = /^\s*$/.test(line)) {
_results.push(line);
} else {
_results.push('# ' + line);
}

View File

@@ -512,9 +512,6 @@
if (indent) {
doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
}
if (this.literate) {
doc = doc.replace(/\n# \n/g, '\n\n');
}
if (!herecomment) {
doc = doc.replace(/^\n/, '');
}