This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; |