Skip to content
Permalink
Browse files

Fix bibliography code to be compatible with new no-"name" HTML conven…

…tion.
  • Loading branch information
lapets committed Feb 8, 2017
1 parent 88df7aa commit a5e0693f7945e99fd2b25a885e8a27aa17aff0c1
Showing with 6 additions and 6 deletions.
  1. +6 −6 sheaf.js
@@ -33,15 +33,15 @@ $(document).ready(function() {
});

// Update links to references with indices.
var nameToBibIndex = {};
var idToBibIndex = {};
$('.cite').each(function() {
var name = $(this)[0].children[0].name, index = $(this)[0].innerText.slice(1,-1);
nameToBibIndex[name] = index;
var id = $(this)[0].children[0].id, index = $(this)[0].innerText.slice(1,-1);
idToBibIndex[id] = index;
});
$('a').each(function() {
var name = $(this)[0].attributes[0].nodeValue.slice(1);
if (nameToBibIndex[name] != null && $(this)[0].childNodes[0].data == '#')
$(this)[0].childNodes[0].data = nameToBibIndex[name];
var id = $(this)[0].attributes[0].nodeValue.slice(1);
if (idToBibIndex[id] != null && $(this)[0].childNodes[0].data == '#')
$(this)[0].childNodes[0].data = idToBibIndex[id];
});
})

0 comments on commit a5e0693

Please sign in to comment.
You can’t perform that action at this time.