Skip to content

Instantly share code, notes, and snippets.

View harryfk's full-sized avatar

Harry Keller harryfk

View GitHub Profile
(function () {
var footnotes = function () {
return [
{ type: 'lang', filter: function(text) {
// Use footnotes like so: "foo[^1](This is the footnote text)"
var i = 0;
var inline_regex = /\[\^(\d|n)\]\((.*?)\)/g;
text = text.replace(inline_regex, function(match, n, t) {
// We allow both automatic and manual footnote numbering
if (n == "n") n = i+1;