wtf_wikipedia
wtf_wikipedia copied to clipboard
support images in tables
So i have this wiki for a game Link
And they have this table with some images and looks like images()
function is not catching those images?
Here my code:
const page = await wiki.fetch(title, {
domain: 'www.miragerealms.co.uk',
path: 'wiki/api.php'
})
const test = page.images().map(image => image.url())
console.log(test)
hey @qxb3 - good catch. it's not looking for images inside tables.
let str = `
{|
|-
| [[File:Sword-0.png]]
| [[Primitive Sword]]
| 4
| 15
|}
`
let doc = wtf(str)
console.log(doc.images())
i'm happy to add this in the next release. Can try to do it next week. cheers
Alright. Thanks!
hey qxb3, this one is harder than i thought and will require a refactor. pushing it to next major release. thanks.