Fixing broken BBC links which have oddball hashes.

This commit is contained in:
Samuel Clay 2014-01-08 11:25:32 -08:00
parent 4dc30085f8
commit 26cf69892a

View file

@ -568,9 +568,13 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
// Fix footnotes // Fix footnotes
if (_.string.contains(href, "#")) { if (_.string.contains(href, "#")) {
footnote_href = href.replace(/^.*?\#(.*?)$/, "\#$1") try {
.replace(':', "\\\:"); footnote_href = href.replace(/^.*?\#(.*?)$/, "\#$1")
var $footnote = $(footnote_href); .replace(':', "\\\:");
var $footnote = $(footnote_href);
} catch (err) {
$footnote = [];
}
if ($footnote.length) { if ($footnote.length) {
href = footnote_href; href = footnote_href;
var offset = $(href).offset().top; var offset = $(href).offset().top;