Skip to content

Commit

Permalink
Merge pull request starfishmod#62 from tresni/patch-1
Browse files Browse the repository at this point in the history
Fix wikipedia link cleaning
  • Loading branch information
starfishmod committed Jan 23, 2013
2 parents 85b9fe6 + 406367b commit 114c441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.oembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
new $.fn.oembed.OEmbedProvider("wikipedia", "rich", ["wikipedia.org/wiki/.+"], "http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json&section=0&callback=?",{
templateRegex:/.*\/\/([\w]+).*\/wiki\/([^\/]+).*/,
templateData : function(data){if(!data.parse)return false;
var text = data.parse['text']['*'].replace('href="/wiki','href="http://en.wikipedia.org/wiki');
var text = data.parse['text']['*'].replace(/href="\/wiki/g,'href="http://en.wikipedia.org/wiki');
return '<div id="content"><h3><a class="nav-link" href="http://en.wikipedia.org/wiki/'+data.parse['displaytitle']+'">'+data.parse['displaytitle']+'</a></h3>'+text+'</div>';
}
}),
Expand Down

0 comments on commit 114c441

Please sign in to comment.