Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Mar 25, 2020
1 parent 0c44fae commit 1477960
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 58 deletions.
27 changes: 14 additions & 13 deletions builds/wtf_wikipedia-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion builds/wtf_wikipedia-client.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/wtf_wikipedia-client.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/wtf_wikipedia-client.mjs

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions builds/wtf_wikipedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,18 @@

var parse$2 = sentence_parser;

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, ''); //these semi-colons in parentheses are particularly troublesome

line = line.replace(/\( *(; ?)+/g, '('); //dangling punctuation

line = helpers.trim_whitespace(line);
line = line.replace(/ +\.$/, '.');
return line;
} // returns one sentence object


function fromText(str) {
var obj = {
text: str
Expand All @@ -3341,17 +3353,6 @@
obj = formatting_1(obj); //pull-out things like {{start date|...}}

return new Sentence_1(obj);
}

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, ''); //these semi-colons in parentheses are particularly troublesome

line = line.replace(/\( *(; ?)+/g, '('); //dangling punctuation

line = helpers.trim_whitespace(line);
line = line.replace(/ +\.$/, '.');
return line;
} //used for consistency with other class-definitions


Expand Down Expand Up @@ -3801,7 +3802,7 @@
var getColSpan = /.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/; //colspans stretch ←left/right→

var doColSpan = function doColSpan(rows) {
rows.forEach(function (row, r) {
rows.forEach(function (row) {
row.forEach(function (str, c) {
var m = str.match(getColSpan);

Expand Down Expand Up @@ -4563,7 +4564,7 @@
list: list
};

var parseParagraphs = function parseParagraphs(section, doc) {
var parseParagraphs = function parseParagraphs(section) {
var wiki = section.wiki;
var paragraphs = wiki.split(twoNewLines); //don't create empty paragraphs

Expand Down
27 changes: 14 additions & 13 deletions builds/wtf_wikipedia.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,18 @@ var sentence_parser = function sentence_parser(text) {

var parse$2 = sentence_parser;

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, ''); //these semi-colons in parentheses are particularly troublesome

line = line.replace(/\( *(; ?)+/g, '('); //dangling punctuation

line = helpers.trim_whitespace(line);
line = line.replace(/ +\.$/, '.');
return line;
} // returns one sentence object


function fromText(str) {
var obj = {
text: str
Expand All @@ -3335,17 +3347,6 @@ function fromText(str) {
obj = formatting_1(obj); //pull-out things like {{start date|...}}

return new Sentence_1(obj);
}

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, ''); //these semi-colons in parentheses are particularly troublesome

line = line.replace(/\( *(; ?)+/g, '('); //dangling punctuation

line = helpers.trim_whitespace(line);
line = line.replace(/ +\.$/, '.');
return line;
} //used for consistency with other class-definitions


Expand Down Expand Up @@ -3795,7 +3796,7 @@ var getRowSpan = /.*rowspan *?= *?["']?([0-9]+)["']?[ \|]*/;
var getColSpan = /.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/; //colspans stretch ←left/right→

var doColSpan = function doColSpan(rows) {
rows.forEach(function (row, r) {
rows.forEach(function (row) {
row.forEach(function (str, c) {
var m = str.match(getColSpan);

Expand Down Expand Up @@ -4557,7 +4558,7 @@ var parse$5 = {
list: list
};

var parseParagraphs = function parseParagraphs(section, doc) {
var parseParagraphs = function parseParagraphs(section) {
var wiki = section.wiki;
var paragraphs = wiki.split(twoNewLines); //don't create empty paragraphs

Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default [
entries: [{ find: './http/server', replacement: './http/client' }]
}),
terser(),
sizeCheck({ expect: 103, warn: 10 })
sizeCheck({ expect: 123, warn: 10 })
]
},
// === client-side .mjs ===
Expand All @@ -115,7 +115,7 @@ export default [
entries: [{ find: './http/server', replacement: './http/client' }]
}),
terser(),
sizeCheck({ expect: 103, warn: 10 })
sizeCheck({ expect: 123, warn: 10 })
]
}
]
3 changes: 1 addition & 2 deletions src/03-paragraph/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Paragraph = require('./Paragraph')
const find_recursive = require('../image/nested_find')
const parseSentences = require('../04-sentence').byParagraph

const twoNewLines = /\r?\n\r?\n/
Expand All @@ -8,7 +7,7 @@ const parse = {
list: require('../list')
}

const parseParagraphs = function(section, doc) {
const parseParagraphs = function(section) {
let wiki = section.wiki
let paragraphs = wiki.split(twoNewLines)
//don't create empty paragraphs
Expand Down
22 changes: 11 additions & 11 deletions src/04-sentence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ const parseFmt = require('./formatting')
const Sentence = require('./Sentence')
const sentenceParser = require('./parse')

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, '')
//these semi-colons in parentheses are particularly troublesome
line = line.replace(/\( *(; ?)+/g, '(')
//dangling punctuation
line = helpers.trim_whitespace(line)
line = line.replace(/ +\.$/, '.')
return line
}

// returns one sentence object
function fromText(str) {
let obj = {
Expand All @@ -18,17 +29,6 @@ function fromText(str) {
return new Sentence(obj)
}

function postprocess(line) {
//remove empty parentheses (sometimes caused by removing templates)
line = line.replace(/\([,;: ]*\)/g, '')
//these semi-colons in parentheses are particularly troublesome
line = line.replace(/\( *(; ?)+/g, '(')
//dangling punctuation
line = helpers.trim_whitespace(line)
line = line.replace(/ +\.$/, '.')
return line
}

//used for consistency with other class-definitions
const byParagraph = function(paragraph) {
// array of texts
Expand Down
2 changes: 1 addition & 1 deletion src/table/parse/_spans.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const getColSpan = /.*colspan *?= *?["']?([0-9]+)["']?[ \|]*/

//colspans stretch ←left/right→
const doColSpan = function(rows) {
rows.forEach((row, r) => {
rows.forEach(row => {
row.forEach((str, c) => {
let m = str.match(getColSpan)
if (m !== null) {
Expand Down

0 comments on commit 1477960

Please sign in to comment.