rustdoc: Check for href when prepending rootPath

Fixes #18354.
This commit is contained in:
Paul Collier 2014-12-01 20:43:50 -08:00
parent 8a210af7e5
commit e407472f90

View File

@ -707,8 +707,8 @@
var code = $('<code>').append(structs[j]);
$.each(code.find('a'), function(idx, a) {
var href = $(a).attr('href');
if (!href.startsWith('http')) {
$(a).attr('href', rootPath + $(a).attr('href'));
if (href && !href.startsWith('http')) {
$(a).attr('href', rootPath + href);
}
});
var li = $('<li>').append(code);