Skip to content

Commit

Permalink
take a stance on semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Stewmon committed Dec 4, 2017
1 parent 912536a commit fc503dc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Expand Up @@ -179,7 +179,7 @@ rules:
quotes: 0
require-jsdoc: 0
semi-spacing: 0
semi: 0
semi: [error, always]
sort-vars: 0
space-after-keywords: 0
space-before-blocks: 0
Expand Down
2 changes: 1 addition & 1 deletion example/html-to-text.js
Expand Up @@ -2,7 +2,7 @@ var path = require('path');

var htmlToText = require('../lib/html-to-text');

console.log('fromString:')
console.log('fromString:');
var text = htmlToText.fromString('<h1>Hello World</h1>', {
wordwrap: 130
});
Expand Down
14 changes: 7 additions & 7 deletions lib/formatter.js
Expand Up @@ -38,11 +38,11 @@ function formatLineBreak(elem, fn, options) {
}

function formatParagraph(elem, fn, options) {
var paragraph = fn(elem.children, options)
var paragraph = fn(elem.children, options);
if (options.singleNewLineParagraphs) {
return paragraph + '\n'
return paragraph + '\n';
} else {
return paragraph + '\n\n'
return paragraph + '\n\n';
}
}

Expand Down Expand Up @@ -139,12 +139,12 @@ function formatOrderedList(elem, fn, options) {
// TODO Imeplement the other valid types
// Fallback to type '1' function for other valid types
switch(olType) {
case 'a': return function(start, i) { return String.fromCharCode(i + start + 97)};
case 'A': return function(start, i) { return String.fromCharCode(i + start + 65)};
case 'a': return function(start, i) { return String.fromCharCode(i + start + 97);};
case 'A': return function(start, i) { return String.fromCharCode(i + start + 65);};
case '1':
default: return function(start, i) { return i + 1 + start};
default: return function(start, i) { return i + 1 + start;};
}
}())
}());
// Make sure there are list items present
if (nonWhiteSpaceChildren.length) {
// Calculate initial start from ol attribute
Expand Down
4 changes: 2 additions & 2 deletions lib/html-to-text.js
Expand Up @@ -69,8 +69,8 @@ function filterBody(dom, options, baseElement) {
var documentClasses = elem.attribs && elem.attribs.class ? elem.attribs.class.split(" ") : [];
var documentIds = elem.attribs && elem.attribs.id ? elem.attribs.id.split(" ") : [];

if ((splitTag.classes.every(function (val) { return documentClasses.indexOf(val) >= 0 })) &&
(splitTag.ids.every(function (val) { return documentIds.indexOf(val) >= 0 }))) {
if ((splitTag.classes.every(function (val) { return documentClasses.indexOf(val) >= 0; })) &&
(splitTag.ids.every(function (val) { return documentIds.indexOf(val) >= 0; }))) {
result = [elem];
return;
}
Expand Down
4 changes: 2 additions & 2 deletions test/html-to-text.js
Expand Up @@ -370,7 +370,7 @@ describe('html-to-text', function() {
}
});
expect(result).to.equal('====\ntest\n====');
})
});
});

describe('Base element', function () {
Expand Down Expand Up @@ -605,5 +605,5 @@ describe('html-to-text', function() {
testString += "</body></html>";
expect(htmlToText.fromString(testString)).to.equal(expectedResult);
});
})
});
});

0 comments on commit fc503dc

Please sign in to comment.