mediawiki-projects-list 1.2.1 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -60,8 +60,8 @@ function inputToWikiProject(input) {
60
60
  let result = null;
61
61
  let wikiProject = wikiProjects.find( wikiProject => input.split('/').slice(0, 3).some( part => part.endsWith( wikiProject.name ) ) );
62
62
  if ( wikiProject ) {
63
- let articlePath = ( wikiProject.regexPaths ? '/' : wikiProject.articlePath );
64
- let scriptPath = ( wikiProject.regexPaths ? '/' : wikiProject.scriptPath );
63
+ let articlePath = ( wikiProject.regexPaths ? '/' : wikiProject.articlePath.split('?')[0] ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
64
+ let scriptPath = ( wikiProject.regexPaths ? '/' : wikiProject.scriptPath ).replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
65
65
  let regex = input.match( new RegExp( wikiProject.regex + `(?:${articlePath}|${scriptPath}|/?$)` ) );
66
66
  if ( regex ) {
67
67
  if ( wikiProject.regexPaths ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediawiki-projects-list",
3
- "version": "1.2.1",
3
+ "version": "1.2.4",
4
4
  "type": "commonjs",
5
5
  "description": "List of MediaWiki projects for use in discord-wiki-bot",
6
6
  "main": "index.js",
package/projects.json CHANGED
@@ -72,6 +72,20 @@
72
72
  "scriptPath": "/",
73
73
  "fullScriptPath": "https://www.dragon-mania-legends.wiki/"
74
74
  },
75
+ {
76
+ "name": "toweroffantasy.wiki",
77
+ "regex": "((?:www\\.)?toweroffantasy\\.wiki)",
78
+ "articlePath": "/w/",
79
+ "scriptPath": "/",
80
+ "fullScriptPath": "https://toweroffantasy.wiki/"
81
+ },
82
+ {
83
+ "name": "dwarffortresswiki.org",
84
+ "regex": "((?:www\\.)?dwarffortresswiki\\.org)",
85
+ "articlePath": "/index.php/",
86
+ "scriptPath": "/",
87
+ "fullScriptPath": "https://dwarffortresswiki.org/"
88
+ },
75
89
  {
76
90
  "name": "micronations.wiki",
77
91
  "regex": "((?:([a-z-]{2,12})\\.)?micronations\\.wiki)",
@@ -91,6 +105,13 @@
91
105
  "scriptPath": "/wiki/",
92
106
  "fullScriptPath": "https://psu-clementine.net/wiki/"
93
107
  },
108
+ {
109
+ "name": "miragerealms.co.uk",
110
+ "regex": "((?:www\\.)?miragerealms\\.co\\.uk)",
111
+ "articlePath": "/wiki/index.php/",
112
+ "scriptPath": "/wiki/",
113
+ "fullScriptPath": "https://www.miragerealms.co.uk/wiki/"
114
+ },
94
115
  {
95
116
  "name": "lostmediawiki.com",
96
117
  "regex": "((?:www\\.)?lostmediawiki\\.com)",
@@ -1380,6 +1401,13 @@
1380
1401
  "scriptPath": "/w/",
1381
1402
  "fullScriptPath": "https://switchbrew.org/w/"
1382
1403
  },
1404
+ {
1405
+ "name": "wiki.hacks.guide",
1406
+ "regex": "(wiki\\.hacks\\.guide)",
1407
+ "articlePath": "/wiki/",
1408
+ "scriptPath": "/w/",
1409
+ "fullScriptPath": "https://wiki.hacks.guide/w/"
1410
+ },
1383
1411
  {
1384
1412
  "name": "eastwardwiki.com",
1385
1413
  "regex": "((?:([a-z-]{2,12})\\.)?eastwardwiki\\.com)",