wikimedia / html-metadata

MetaData html scraper and parser for Node.js (supports Promises and callback style)
MIT License
138 stars 44 forks source link

Meta tag search should be case insensitive #36

Closed saood1 closed 7 years ago

saood1 commented 8 years ago

I noticed that in some websites the meta tags begin with an Upper case for e.g. <meta name="Description" content=

Currently the application only works for lower case tags and case insensitivity is not supported. I tried to write my own but i just thought this is a simple fix and you can do a quick release for this. I think that the change required would be in the function

exports.parseGeneral = BBPromise.method(function(html) and the change would be meta[name="description" i] and similar case insensitivity reg ex should be applied to all meta tags

Request you to do the needful asap, since this tool captures meta information in most cases but websites like www.microsoft.com "description" tag text is ignored, may be there could be cases were other tags are ignored as well although they might be present in the page

Thanks and great work -Saood

mvolz commented 7 years ago

Hi,

Thanks for noticing this bug! The properties all should be case insensitive but clearly they were not :(. I've added tests for this so hopefully no more of these issues will slip in.

Sorry it took so long to respond, I missed the email notification clearly!

mvolz commented 7 years ago

Published as v1.4.2