diff --git a/lib/parser_block.js b/lib/parser_block.js index ad8009d..4e8ef7a 100644 --- a/lib/parser_block.js +++ b/lib/parser_block.js @@ -62,11 +62,6 @@ ParserBlock.prototype.tokenize = function (state, startLine, endLine) { if (ok) { break; } } - /* istanbul ignore if */ - if (!ok) { throw new Error('No matching rules found'); } - /* istanbul ignore if */ - if (line === state.line) { throw new Error('None of rules updated state.line'); } - // set state.tight iff we had an empty line before current tag // i.e. latest empty line should not count state.tight = !hasEmptyLines; diff --git a/lib/rules_core/linkify.js b/lib/rules_core/linkify.js index 4b31ff5..4bd8625 100644 --- a/lib/rules_core/linkify.js +++ b/lib/rules_core/linkify.js @@ -31,6 +31,7 @@ function createLinkifier() { replaceFn: function (autolinker, match) { // Only collect matched strings but don't change anything. switch (match.getType()) { + /*eslint default-case:0*/ case 'url': links.push({ text: match.matchedText, @@ -44,8 +45,6 @@ function createLinkifier() { url: 'mailto:' + match.getEmail().replace(/^mailto:/i, '') }); break; - /* istanbul ignore next */ - default: } return false; } @@ -121,9 +120,6 @@ module.exports = function linkify(state) { pos = text.indexOf(links[ln].text); - /* istanbul ignore next */ - if (pos === -1) { continue; } // that should never happen - if (pos) { level = level; nodes.push({ diff --git a/test/misc.js b/test/misc.js index 59acadd..89f84f8 100644 --- a/test/misc.js +++ b/test/misc.js @@ -96,14 +96,16 @@ describe('API', function () { var md = new Remarkable({ breaks: true }); assert.strictEqual(md.render('a\nb'), '

a
\nb

\n'); + md.set({ xhtmlOut: true }) + assert.strictEqual(md.render('a\nb'), '

a
\nb

\n'); }); it('xhtmlOut enabled', function () { - var md = new Remarkable({ breaks: true, xhtmlOut: true }); + var md = new Remarkable({ xhtmlOut: true }); assert.strictEqual(md.render('---'), '
\n'); assert.strictEqual(md.render('![]()'), '

\n'); - assert.strictEqual(md.render('a\nb'), '

a
\nb

\n'); + assert.strictEqual(md.render('a \\\nb'), '

a
\nb

\n'); }); it('xhtmlOut disabled', function () {