Compiling MMD to FODT messes up footnotes

The attached ZIP file contains a very simple Scrivener file with two footnotes. It compiles find to “preview” and to .DOC format, but compiling MMD to FODT results in corrupted footnotes. I open the resulting file in LibreOffice, and rather than seeing the expected two footnotes I see three - but the first and third have empty content, and the content of the first appears in the document text. (239 KB)

That is pretty bizarre usage of footnoting in my experience, I’ve never heard of putting the marker in the middle of a word like that. At any rate, what is most useful when debugging problems is to start with the plain MultiMarkdown format. That is what Scrivener produces, and if that looks correct (it should be like the following), then try other formats and see if they work, to determine whether or not it is a problem with LibreOffice, the .fodt format, or maybe even the MultiMarkdown engine itself. You are testing too many systems at once by only choosing one format and looking at the end result.

[code]Foo The Prince^cf1.

b^cf2ar .


The footnote in the middle of the word was just me not cleaning my test case up enough. Here’s a better version. Scrivener has this (with a footnote for each of the two lines):

Foo *The Prince[Glop]*. *Bar[Bar]*.

Compiling to MMD gives this:

[code]Foo The Prince^fn1.
^fn1: Glop

Compiling MultiMarkdown to OpenDocument Flat XML (.fodt) gives a file which when opened in LibreOffice has three footnotes, of which the first and third are empty (the middle one reads “Bar”).

Taking the output of compiling to MMD and processing it with MMD to produce HTML, I get a clearly-incorrect file (note that it has three footnotes, but I only specified two):


Foo The Prince[1].
[3]: Glop

  1. fn1  ↩

  2. Bar  ↩

  3. fn1  ↩


Aha! Putting in a blank line separating text from footnotes is essential - compiling the following with MMD works:

[code]Foo The Prince^fn1.

To get Scrivener to correctly process footnotes, all I need to do is make sure that the last section in my selection of things to compile ends with a blank line.

I can make this work - but it would be nice if Scrivener took care of this for me and any other users who run up against the same issue. :slight_smile: