summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-10 20:46:03 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-10 20:46:03 -0800
commit1db8dd8d674229c102cd5839f56e5e50068fb4be (patch)
treef896ed83d98971a1874efc845cb31e970c46bee0
parentd9e21b680909b633831fd7e1d998e56ebfc37555 (diff)
Fixed linter errors in js/bin/commonmark, js/test.js.
-rwxr-xr-xjs/bin/commonmark8
-rwxr-xr-xjs/test.js8
2 files changed, 8 insertions, 8 deletions
diff --git a/js/bin/commonmark b/js/bin/commonmark
index 1d395e0..3c222f8 100755
--- a/js/bin/commonmark
+++ b/js/bin/commonmark
@@ -1,17 +1,17 @@
#!/usr/bin/env node
+"use strict";
+
var fs = require('fs');
var util = require('util');
var commonmark = require('../lib/index.js');
-var parser = new commonmark.DocParser();
+var parser = new commonmark.DocParser();
var renderer;
var inps = [];
-
-var output_ast = false;
+var file;
var files = [];
if (process.argv[2] === '--ast') {
- output_ast = true;
files = process.argv.slice(3);
renderer = { render: function(x) {
return util.inspect(x, null, Infinity) + '\n';
diff --git a/js/test.js b/js/test.js
index 5427bbf..73ec450 100755
--- a/js/test.js
+++ b/js/test.js
@@ -1,4 +1,5 @@
#!/usr/bin/env node
+"use strict";
var fs = require('fs');
var commonmark = require('./lib/index.js');
@@ -13,8 +14,8 @@ var failed = 0;
var showSpaces = function(s) {
var t = s;
- return t.replace(/\t/g,'→')
- .replace(/ /g,'␣');
+ return t.replace(/\t/g, '→')
+ .replace(/ /g, '␣');
};
fs.readFile('spec.txt', 'utf8', function(err, data) {
@@ -30,7 +31,7 @@ fs.readFile('spec.txt', 'utf8', function(err, data) {
.replace(/^<!-- END TESTS -->(.|[\n])*/m, '');
tests.replace(/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$|^#{1,6} *(.*)$/gm,
- function(_,markdownSubmatch,htmlSubmatch,sectionSubmatch){
+ function(_, markdownSubmatch, htmlSubmatch, sectionSubmatch){
if (sectionSubmatch) {
current_section = sectionSubmatch;
} else {
@@ -79,4 +80,3 @@ fs.readFile('spec.txt', 'utf8', function(err, data) {
console.timeEnd("Elapsed time");
});
-