Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing semicolons, add lint rule #1340

Merged
merged 3 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"parserOptions": { "ecmaVersion": 5 },
"rules": {
"semi": "off",
"semi": ["error", "always"],
"indent": ["warn", 2, {
"VariableDeclarator": { "var": 2 },
"SwitchCase": 1,
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $previewIframe.addEventListener('load', function () {
iframeLoaded = true;
inputDirty = true;
checkForChanges();
})
});

if ('text' in search) {
$inputElem.value = search.text;
Expand Down
20 changes: 10 additions & 10 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ InlineLexer.prototype.output = function(src) {
? this.options.sanitizer
? this.options.sanitizer(cap[0])
: escape(cap[0])
: cap[0]
: cap[0];
continue;
}

Expand Down Expand Up @@ -847,7 +847,7 @@ InlineLexer.prototype.output = function(src) {

InlineLexer.escapes = function(text) {
return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
}
};

/**
* Compile Link
Expand Down Expand Up @@ -983,7 +983,7 @@ Renderer.prototype.checkbox = function(checked) {
+ 'disabled="" type="checkbox"'
+ (this.options.xhtml ? ' /' : '')
+ '> ';
}
};

Renderer.prototype.paragraph = function(text) {
return '<p>' + text + '</p>\n';
Expand Down Expand Up @@ -1093,16 +1093,16 @@ TextRenderer.prototype.codespan =
TextRenderer.prototype.del =
TextRenderer.prototype.text = function (text) {
return text;
}
};

TextRenderer.prototype.link =
TextRenderer.prototype.image = function(href, title, text) {
return '' + text;
}
};

TextRenderer.prototype.br = function() {
return '';
}
};

/**
* Parsing & Compiling
Expand Down Expand Up @@ -1289,11 +1289,11 @@ Parser.prototype.tok = function() {
function escape(html, encode) {
if (encode) {
if (escape.escapeTest.test(html)) {
return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch] });
return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; });
}
} else {
if (escape.escapeTestNoEncode.test(html)) {
return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch] });
return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; });
}
}

Expand Down Expand Up @@ -1473,7 +1473,7 @@ function marked(src, opt, callback) {
i = 0;

try {
tokens = Lexer.lex(src, opt)
tokens = Lexer.lex(src, opt);
} catch (e) {
return callback(e);
}
Expand Down Expand Up @@ -1572,7 +1572,7 @@ marked.getDefaults = function () {
tables: true,
xhtml: false
};
}
};

marked.defaults = marked.getDefaults();

Expand Down
6 changes: 3 additions & 3 deletions test/specs/commonmark/commonmark-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ var HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer,
htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true});
var since = require('jasmine2-custom-message');

var Messenger = function() {}
var Messenger = function() {};

Messenger.prototype.message = function(spec, expected, actual) {
return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual;
}
};

Messenger.prototype.test = function(spec, section, ignore) {
if (spec.section === section) {
Expand All @@ -21,7 +21,7 @@ Messenger.prototype.test = function(spec, section, ignore) {
).toEqual(!shouldFail);
});
}
}
};

var messenger = new Messenger();
/*
Expand Down
8 changes: 4 additions & 4 deletions test/specs/gfm/gfm-spec.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var marked = require('../../../lib/marked.js');
var gfmSpec = require('./gfm.0.28.json')
var gfmSpec = require('./gfm.0.28.json');
var HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer,
htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true});
var since = require('jasmine2-custom-message');

var Messenger = function() {}
var Messenger = function() {};

Messenger.prototype.message = function(spec, expected, actual) {
return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual;
}
};

Messenger.prototype.test = function(spec, section, ignore) {
if (spec.section === section && ignore.indexOf(spec.example) < 0) {
Expand All @@ -21,7 +21,7 @@ Messenger.prototype.test = function(spec, section, ignore) {
).toEqual(!shouldFail);
});
}
}
};

var messenger = new Messenger();

Expand Down
6 changes: 3 additions & 3 deletions test/specs/marked/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ var HtmlDiffer = require('@markedjs/html-differ').HtmlDiffer,
htmlDiffer = new HtmlDiffer({ignoreSelfClosingSlash: true});
var since = require('jasmine2-custom-message');

var Messenger = function() {}
var Messenger = function() {};

Messenger.prototype.message = function(spec, expected, actual) {
return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual;
}
};

Messenger.prototype.test = function(spec, section, ignore) {
if (spec.section === section) {
Expand All @@ -28,7 +28,7 @@ Messenger.prototype.test = function(spec, section, ignore) {
).toEqual(!shouldFail);
});
}
}
};

var messenger = new Messenger();

Expand Down