spencermountain / wtf_wikipedia

a pretty-committed wikipedia markup parser
https://observablehq.com/@spencermountain/wtf_wikipedia
MIT License
770 stars 129 forks source link

isRedirect() is not working properly #534

Closed andremacola closed 1 year ago

andremacola commented 1 year ago

The wiki.length is a problem in many articles. Look for example this one: https://pt.wikipedia.org/w/index.php?title=Ch%C3%A1cara%20Maria%20Trindade&redirect=no or even this crap https://pt.wikipedia.org/w/index.php?title=Newsgroup&action=edit&oldid=62047822 (the last one was fixed by wikipedia)

  if (!wiki || wiki.length > 500) {
    return false
  }

https://github.com/spencermountain/wtf_wikipedia/blob/4a3bc7ed89318dc06ca3be39ff5f7b537decf7cf/src/01-document/redirects.js

Some Wikipedia redirects are buggy and redirect wikitext parameters is sometimes in the second line or even third line inside a list in the text like the example above. Funny is, the redirect works in Wikipedia.

Maybe we could create a better approach to bypass Wikipedia mess.

spencermountain commented 1 year ago

good idea - i've removed the length check on dev branch. i'm not sure if we'll see a full page with a tiny redirect clause on the bottom for some reason - but I guess we'll find out!

spencermountain commented 1 year ago

released in 10.1.5