michalbe / wiki-infobox

Simple Wikipedia infobox scraper
https://github.com/michalbe/wiki-infobox
MIT License
16 stars 8 forks source link

Add support for external links #43

Open michalbe opened 9 years ago

michalbe commented 9 years ago

For now we threat fields like this one |website={{url|www.metro.waw.pl|Metro Warszawskie}})| as simple texts, returning

website: 
  { 
    type: 'text',
    value: '{{url|www.metro.waw.pl|Metro Warszawskie}}' 
  }

We should parse external links exactly as we do with internal, Wiki's, links. Expected result:

website: 
  { 
    type: 'link',
    url: 'www.metro.waw.pl',
    value: 'Metro Warszawskie' 
  }