Skip to content

Instantly share code, notes, and snippets.

@aJanuary
Created July 17, 2013 15:48
Show Gist options
  • Save aJanuary/6021827 to your computer and use it in GitHub Desktop.
Save aJanuary/6021827 to your computer and use it in GitHub Desktop.
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0, len = links.length; i < len; i += 1) {
var link = links[i];
var href = link.getAttribute('href');
if (href != null && href.substring(0, 2) == '#f') {
link.name = 'footnote' + href.substring(2);
} else if (link.name.length >= 1 && link.name[0] == 'f') {
link.href = '#footnote' + link.name.substring(1);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment