Compiling MMD to FODT messes up footnotes

Ri
Rich.Miller.6
Posts: 10
Joined: Wed Sep 21, 2016 2:20 pm
Platform: Windows

Mon Apr 10, 2017 2:38 am Post

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.
Attachments
BadFootnote.zip
(238.79 KiB) Downloaded 5 times

User avatar
AmberV
Posts: 20607
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Mon Apr 10, 2017 4:38 pm Post

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: Select all

Foo *The Prince[^cf1]*.

 *b[^cf2]ar* .

[^cf1]: Glop

[^cf2]: foo
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Ri
Rich.Miller.6
Posts: 10
Joined: Wed Sep 21, 2016 2:20 pm
Platform: Windows

Thu Apr 13, 2017 9:56 pm Post

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):

Code: Select all

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


Compiling to MMD gives this:

Code: Select all

Foo *The Prince[^fn1]*.
 *Bar[^fn2]*.
[^fn1]: Glop

[^fn2]: Bar


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):

Code: Select all

<p>Foo <em>The Prince<a href="#fn:1" id="fnref:1" title="see footnote" class="footnote">[1]</a></em>.
 <em>Bar<a href="#fn:2" id="fnref:2" title="see footnote" class="footnote">[2]</a></em>.
<a href="#fn:3" id="fnref:3" title="see footnote" class="footnote">[3]</a>: Glop</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>fn1 <a href="#fnref:1" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>

<li id="fn:2">
<p>Bar <a href="#fnref:2" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>

<li id="fn:3">
<p>fn1 <a href="#fnref:3" title="return to article" class="reversefootnote">&#160;&#8617;</a></p>
</li>

</ol>
</div>


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

Code: Select all

Foo *The Prince[^fn1]*.
 *Bar[^fn2]*.
 
[^fn1]: Glop

[^fn2]: Bar


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. :-)