@@ -175,12 +175,18 @@ const makeUrl = function (options, parameters = defaults$c) {
175
175
* @returns {* } result
176
176
*/
177
177
const getResult = function ( data , options = { } ) {
178
+ // handle nothing found or no data passed
179
+ if ( ! data ?. query ?. pages || ! data ?. query || ! data ) {
180
+ return null
181
+ }
182
+
178
183
//get all the pagesIds from the result
179
184
let pages = Object . keys ( data . query . pages ) ;
180
185
181
186
// map over the pageIds to parse out all the information
182
187
return pages . map ( ( id ) => {
183
188
// get the page by pageID
189
+
184
190
let page = data . query . pages [ id ] || { } ;
185
191
186
192
// if the page is missing or not found than return null
@@ -1978,13 +1984,14 @@ const ignore$1 = [
1978
1984
'source' ,
1979
1985
'syntaxhighlight' ,
1980
1986
'timeline' ,
1987
+ 'maplink' ,
1981
1988
] ;
1982
1989
const openTag = `< ?(${ ignore$1 . join ( '|' ) } ) ?[^>]{0,200}?>` ;
1983
1990
const closeTag = `< ?/ ?(${ ignore$1 . join ( '|' ) } ) ?>` ;
1984
1991
const anyChar = '\\s\\S' ; //including newline
1985
1992
const noThanks = new RegExp ( `${ openTag } [${ anyChar } ]+?${ closeTag } ` , 'gi' ) ;
1986
1993
1987
- const kill_xml = function ( wiki ) {
1994
+ const kill_xml = function ( wiki ) {
1988
1995
//(<ref> tags are parsed in Section class) - luckily, refs can't be recursive.
1989
1996
//types of html/xml that we want to trash completely.
1990
1997
wiki = wiki . replace ( noThanks , ' ' ) ;
@@ -10509,7 +10516,7 @@ const fetch = function (title, options, callback) {
10509
10516
} )
10510
10517
} ;
10511
10518
10512
- var version = '10.1.6 ' ;
10519
+ var version = '10.1.7 ' ;
10513
10520
10514
10521
/**
10515
10522
* use the native client-side fetch function
0 commit comments