Fixed footnotes regexp

This commit is contained in:
benweet 2013-06-24 21:04:50 +01:00
parent 797fa169cd
commit 41cc036a43

View File

@ -32,10 +32,10 @@ define([
footnotes = {}; footnotes = {};
usedFootnotes = []; usedFootnotes = [];
text = text.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?(.*?)\n{1,2}((?=\n[ ]{0,3}\S)|\Z)/g, function(wholeMatch, m1, m2) { text = text.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|\Z)/g, function(wholeMatch, m1, m2) {
m1 = utils.slugify(m1); m1 = utils.slugify(m1);
m2 += "\n"; m2 += "\n";
m2 = m2.replace(/^[ ]{0,3}/gm, ""); m2 = m2.replace(/^[ ]{0,3}/g, "");
footnotes[m1] = m2; footnotes[m1] = m2;
return "\n"; return "\n";
}); });