I'm using Low Replace to allow users to add footnotes to the content of their entries. Anything wrapped in square brackets (like this: [[This would become a footnote.]]
) will then be replaced with the appropriate markup on the front-end. Here is the code thus far:
{exp:low_replace find="SPACE\[\[(.*?)\]\]" replace="<span class=QUOTEfootnote-numberQUOTE>¹</span><span class=QUOTEfootnoteQUOTE><span class=QUOTEfootnote-numberQUOTE>¹</span> $1</span>" regex="yes"}
{blog_post_content}
{/exp:low_replace}
There will often be multiple footnotes for one entry, so I need to be able to increment that ¹
with each footnote that's found. So, for example, if there were three footnotes they would be marked-up like this:
<span class="footnote"><span class="footnote-number">¹</span> Footnote content…</span>
<span class="footnote"><span class="footnote-number">²</span> Footnote content…</span>
<span class="footnote"><span class="footnote-number">³</span> Footnote content…</span>
How can I increment that number with each footnote?