dijs / wiki

Wikipedia Interface for Node.js
MIT License
315 stars 61 forks source link

comment in info() #84

Closed Aviortheking closed 5 years ago

Aviortheking commented 5 years ago

when i tried using with for the info()

page : https://fr.wikipedia.org/wiki/Ph%C3%A8dre_(S%C3%A9n%C3%A8que)

i get

typeSupportEnregistrement

<!-- Lister les données des sections ci-après entre les balises <div></div> 
ET penser à retirer les balises <!- -> lorsque les sections sont renseignées -->
<!--

personnages (correct one)

Hippolyte fils de Thésée
Phèdre (mythologie)

tirades

<div>
</div> -->
<!--

adaptations

<div>
</div> -->
<!--

notes

<div>
</div> -->

my code :

wiki({ apiUrl: 'https://fr.wikipedia.org/w/api.php' }).search(page,1).then((data) => {
    wiki({ apiUrl: 'https://fr.wikipedia.org/w/api.php' }).page(data.results[0]).then(p => {
        Promise.all([p.summary(), p.info(), /*p.mainImage()*/]).then(c => {
            for (const element in c[1]) {
                if(!["titlestyle", "image", "caption", "converted"].includes(element)) {
                    rich.addField(element, c[1][element], true);
                }
            }
        });
    });
});
dijs commented 5 years ago

Fix will be in v4.8.1