Hi,

I'm working with a long pandoc-flavoured Markdown file generated by Scrivener. All the footnotes appear at the end of the document. I'd like to be able to process the Markdown file to shift each footnote to immediately follow the paragraph which contains the footnote reference. I don't want to inline the footnotes, because some of the footnotes have multiple paragraphs.

So I would like to transform something like this:

```
This is the first paragraph.[^1]

This is the second paragraph.[^2]

[^1]: First footnote.

     The first footnote has two paragraphs.

[^2]: Second footnote.
````

To something like this:

```
This is the first paragraph.[^1]

[^1]: First footnote.

     The first footnote has two paragraphs.

This is the second paragraph.[^2]

[^2]: Second footnote.
````

Is there a straightforward way to do this? E.g. as a pandoc lua filter or custom writer?

Thanks,
Lyndon

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/868187f2-1fd4-4009-b48e-2a948749b518n%40googlegroups.com.