Skip to content

Commit

Permalink
Merge pull request #499 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain committed Oct 3, 2022
2 parents b406391 + 34606fd commit 87529bd
Show file tree
Hide file tree
Showing 15 changed files with 851 additions and 329 deletions.
4 changes: 2 additions & 2 deletions builds/wtf_wikipedia-client.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions builds/wtf_wikipedia-client.mjs

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions builds/wtf_wikipedia.cjs
@@ -1,4 +1,4 @@
/*! wtf_wikipedia 10.0.2 MIT */
/*! wtf_wikipedia 10.0.3 MIT */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('isomorphic-unfetch')) :
typeof define === 'function' && define.amd ? define(['isomorphic-unfetch'], factory) :
Expand Down Expand Up @@ -2702,6 +2702,11 @@
if (quotes && quotes.length % 2 !== 0 && str.length < 900) {
return false
}
//make sure quotes are closed too
const parens = str.match(/[()]/g);
if (parens && parens.length % 2 !== 0 && str.length < 900) {
return false
}
return true
};

Expand Down Expand Up @@ -4063,7 +4068,11 @@
mlbbioret: true,
};

const i18nReg = new RegExp('^(subst.)?(' + infoboxes$1.join('|') + ')[: \n]', 'i');
const i18nReg = new RegExp('^(subst.)?(' + infoboxes$1.join('|') + ')(?=:| |\n|$)', 'i');
infoboxes$1.forEach(name => {
infoboxes[name] = true;
});

//some looser ones
const startReg = /^infobox /i;
const endReg = / infobox$/i;
Expand Down Expand Up @@ -7667,7 +7676,7 @@
return
}
// is it an Infobox?
if (json.template === 'infobox' && json.subbox !== 'yes') {
if (json.template === 'infobox' && json.subbox !== 'yes' && !obj.nested) {
json.domain = domain; //infoboxes need this for images, i guess
json.data = json.data || {}; //validate it a little
res.infoboxes.push(new Infobox(json, obj.wiki));
Expand Down Expand Up @@ -7698,6 +7707,7 @@
list.push({
name: obj.name,
wiki: obj.body,
nested: Boolean(obj.parent),
text: text,
json: json,
});
Expand Down Expand Up @@ -9413,7 +9423,7 @@
})
};

var version = '10.0.2';
var version = '10.0.3';

/**
* use the native client-side fetch function
Expand Down
18 changes: 14 additions & 4 deletions builds/wtf_wikipedia.mjs
@@ -1,4 +1,4 @@
/*! wtf_wikipedia 10.0.2 MIT */
/*! wtf_wikipedia 10.0.3 MIT */
import unfetch from 'isomorphic-unfetch';

/**
Expand Down Expand Up @@ -2694,6 +2694,11 @@ const isBalanced = function (str) {
if (quotes && quotes.length % 2 !== 0 && str.length < 900) {
return false
}
//make sure quotes are closed too
const parens = str.match(/[()]/g);
if (parens && parens.length % 2 !== 0 && str.length < 900) {
return false
}
return true
};

Expand Down Expand Up @@ -4055,7 +4060,11 @@ var infoboxes = {
mlbbioret: true,
};

const i18nReg = new RegExp('^(subst.)?(' + infoboxes$1.join('|') + ')[: \n]', 'i');
const i18nReg = new RegExp('^(subst.)?(' + infoboxes$1.join('|') + ')(?=:| |\n|$)', 'i');
infoboxes$1.forEach(name => {
infoboxes[name] = true;
});

//some looser ones
const startReg = /^infobox /i;
const endReg = / infobox$/i;
Expand Down Expand Up @@ -7659,7 +7668,7 @@ const sortOut = function (list, domain) {
return
}
// is it an Infobox?
if (json.template === 'infobox' && json.subbox !== 'yes') {
if (json.template === 'infobox' && json.subbox !== 'yes' && !obj.nested) {
json.domain = domain; //infoboxes need this for images, i guess
json.data = json.data || {}; //validate it a little
res.infoboxes.push(new Infobox(json, obj.wiki));
Expand Down Expand Up @@ -7690,6 +7699,7 @@ const allTemplates = function (wiki, doc) {
list.push({
name: obj.name,
wiki: obj.body,
nested: Boolean(obj.parent),
text: text,
json: json,
});
Expand Down Expand Up @@ -9405,7 +9415,7 @@ const fetch = function (title, options, callback) {
})
};

var version = '10.0.2';
var version = '10.0.3';

/**
* use the native client-side fetch function
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Expand Up @@ -2,6 +2,11 @@
#### [unreleased ]
-->
#### 10.0.3 [Oct 2022]
- **[fix]** - improved i18n infobox classification
- **[update]** - dependencies


#### 10.0.2 [Jul 2022]
- **[fix]** - multiple inline templates in a heading #489
- **[fix]** - non-i18n list templates #475
Expand Down

0 comments on commit 87529bd

Please sign in to comment.