Skip to content

Commit

Permalink
fixes web reference screenshot not parsed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Jul 28, 2015
1 parent 1de7cb4 commit cbbf5cb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mod/wikipedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ wikipedia.parseHTML = function(html, key, timeline, callback){
}

var parse_chinese_date = function($, asset){
$('.wikitable').remove();
var html = $.html();
var text = '';
var dateparser = new Dateparser();
Expand All @@ -331,12 +332,9 @@ wikipedia.parseHTML = function(html, key, timeline, callback){
if(!asset){
if(d('.reference')){
var ref = d('.reference a').attr('href');
if(typeof(ref) === 'string' && ref.match(/#cite_note-\d+/)){
// make sure pattern is valid while using jquery selector
var ahref = (ref.indexOf(".."))? undefined: $(ref).find('a.external');
if(ahref){
asset = timeline.asset(ahref.attr('href'), '', ahref.text());
}
var ahref = $(ref).find('a.external');
if(ahref){
asset = timeline.asset(ahref.attr('href'), '', ahref.text());
}
d('.reference').remove();
}
Expand Down

0 comments on commit cbbf5cb

Please sign in to comment.