Skip to content

Commit

Permalink
10.4.0rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Feb 2, 2025
1 parent ec5d8f5 commit 015abc2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 103 deletions.
87 changes: 0 additions & 87 deletions .eslintrc

This file was deleted.

17 changes: 9 additions & 8 deletions builds/wtf_wikipedia.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @returns {{domain: string, title: string}} The domain and title of a url
*/
const parseUrl = function (url) {
let parsed = new URL(url); // eslint-disable-line
let parsed = new URL(url); //eslint-disable-line
let title = parsed.pathname.replace(/^\/(wiki\/)?/, '');
title = decodeURIComponent(title);
return {
Expand Down Expand Up @@ -1208,20 +1208,17 @@
let name = t.template || '';
// try i18n templates like 'stubo'
if (allStubs.has(name)) {
// console.log(name)
return true
}
// english forms
if (name === 'stub' || name.endsWith('-stub')) {
// console.log(name)
return true
}
// look for i18n in last-word, like {{foo-stubo}}
let words = name.split(/[- ]/);
if (words.length > 1) {
let word = words[words.length - 1];
if (allStubs.has(word)) {
// console.log(name)
return true
}
}
Expand Down Expand Up @@ -2157,7 +2154,6 @@
}
//kill off just these just-anchor links [[#history]]
// if (link.match(/^#/i)) {
// console.log(s)
// return s
// }
//remove anchors from end [[toronto#history]]
Expand Down Expand Up @@ -9303,6 +9299,8 @@
sports,
);

/* eslint-disable no-console */

let templates = Object.assign({}, textTmpl, dataTmpl, bothTmpl);

Object.keys(aliases).forEach((k) => {
Expand All @@ -9312,8 +9310,6 @@
templates[k] = templates[aliases[k]];
});

// console.log(Object.keys(templates).length)

const nums = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];

//this gets all the {{template}} objects and decides how to parse them
Expand Down Expand Up @@ -10575,7 +10571,7 @@
};
});

const heading_reg = /^(={1,6})(.{1,200}?)={1,6}$/;
const heading_reg = /^(={1,6})(.{1,200}?)={1,6}$/; //eslint-disable-line
const hasTemplate = /\{\{.+?\}\}/;

const doInlineTemplates = function (wiki, doc) {
Expand Down Expand Up @@ -10723,6 +10719,8 @@
return [categories, newWiki]
};

/* eslint-disable no-console */

const defaults$1 = {
tables: true,
lists: true,
Expand Down Expand Up @@ -11361,6 +11359,7 @@
}
};

/* eslint-disable no-console */
const isUrl = /^https?:\/\//;

/**
Expand Down Expand Up @@ -11444,6 +11443,8 @@

var version = '10.4.0';

/* eslint-disable no-console */

/**
* use the native client-side fetch function
*
Expand Down
17 changes: 9 additions & 8 deletions builds/wtf_wikipedia.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import unfetch from 'isomorphic-unfetch';
* @returns {{domain: string, title: string}} The domain and title of a url
*/
const parseUrl = function (url) {
let parsed = new URL(url); // eslint-disable-line
let parsed = new URL(url); //eslint-disable-line
let title = parsed.pathname.replace(/^\/(wiki\/)?/, '');
title = decodeURIComponent(title);
return {
Expand Down Expand Up @@ -1204,20 +1204,17 @@ const isStub = function (doc) {
let name = t.template || '';
// try i18n templates like 'stubo'
if (allStubs.has(name)) {
// console.log(name)
return true
}
// english forms
if (name === 'stub' || name.endsWith('-stub')) {
// console.log(name)
return true
}
// look for i18n in last-word, like {{foo-stubo}}
let words = name.split(/[- ]/);
if (words.length > 1) {
let word = words[words.length - 1];
if (allStubs.has(word)) {
// console.log(name)
return true
}
}
Expand Down Expand Up @@ -2153,7 +2150,6 @@ const internal_links = function (links, str) {
}
//kill off just these just-anchor links [[#history]]
// if (link.match(/^#/i)) {
// console.log(s)
// return s
// }
//remove anchors from end [[toronto#history]]
Expand Down Expand Up @@ -9299,6 +9295,8 @@ var bothTmpl = Object.assign(
sports,
);

/* eslint-disable no-console */

let templates = Object.assign({}, textTmpl, dataTmpl, bothTmpl);

Object.keys(aliases).forEach((k) => {
Expand All @@ -9308,8 +9306,6 @@ Object.keys(aliases).forEach((k) => {
templates[k] = templates[aliases[k]];
});

// console.log(Object.keys(templates).length)

const nums = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];

//this gets all the {{template}} objects and decides how to parse them
Expand Down Expand Up @@ -10571,7 +10567,7 @@ Object.keys(singular$1).forEach((k) => {
};
});

const heading_reg = /^(={1,6})(.{1,200}?)={1,6}$/;
const heading_reg = /^(={1,6})(.{1,200}?)={1,6}$/; //eslint-disable-line
const hasTemplate = /\{\{.+?\}\}/;

const doInlineTemplates = function (wiki, doc) {
Expand Down Expand Up @@ -10719,6 +10715,8 @@ const parse_categories = function (wiki) {
return [categories, newWiki]
};

/* eslint-disable no-console */

const defaults$1 = {
tables: true,
lists: true,
Expand Down Expand Up @@ -11357,6 +11355,7 @@ const makeHeaders = function (options) {
}
};

/* eslint-disable no-console */
const isUrl = /^https?:\/\//;

/**
Expand Down Expand Up @@ -11440,6 +11439,8 @@ const fetch = function (title, options, callback) {

var version = '10.4.0';

/* eslint-disable no-console */

/**
* use the native client-side fetch function
*
Expand Down

0 comments on commit 015abc2

Please sign in to comment.