You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Marktext should not move footnotes contents to the real end of document #2036
Thank you for taking the time to report this issue. @Jocs Could you please explain, why we put the footnotes that the end of the document and whether it's possible to keep the old position.
The footnotes themselves need not be placed at the end of the document. They may appear anywhere except inside other block elements (lists, block quotes, tables, etc.). Each footnote should be separated from surrounding content (including other footnotes) by blank lines.
At the time of development, it placed at the end of document according to the usual habits, or my personal habits, I did not consider it too much, this will be optimized in the future.
@N0rbert out of curiosity, does Mark Text display [^1] as a number one superscript, i.e. ¹, or is it literally displayed as ^1 in your text? In my Linux installation, Mark Text displays the latter.
Strangely enough, footnotes do not seem to work on my Linux Mintt 18.3 installation and MarkText 0.16.2. Pasting your minimal example in source code mode:
Going back into regular mode, I see:
So:
The syntax [^1] is not resulting in superscripts
the [^1]: footnote line is not being recognised as a footnote line
the save function is not sending it to the end of the file, though this is likely because it is not recognising the syntax [^1]: as a footnote
@gilbertohasnofb this behaviour may be caused by disabled Markdown Extensions (i.e. Use pandoc-style footnotes) in the Preferences. Below is what I have set:
That was it, I did not know that this was not enabled by default. Now I can reproduce your issue and the output looks exactly like the last screenshot.
Thank you for this report. The behavior you described — footnote definitions being moved to the end of the document on save — was a deliberate (but acknowledged as non-ideal) design decision in the old MarkText editor engine (muyajs). The old lexer explicitly collected all footnote tokens and appended them after all other content.
This issue is fully resolved in the current engine (@muyajs/core). The new markdown parser processes footnote definition blocks in document order and the serializer writes them back at their original position. A document whose footnote definitions appear in the middle will round-trip without any repositioning.
Activity
fxha commentedon Jun 7, 2020
Thank you for taking the time to report this issue. @Jocs Could you please explain, why we put the footnotes that the end of the document and whether it's possible to keep the old position.
Jocs commentedon Jun 7, 2020
According pandoc document
At the time of development, it placed at the end of document according to the usual habits, or my personal habits, I did not consider it too much, this will be optimized in the future.
gilbertohasnofb commentedon Oct 30, 2020
@N0rbert out of curiosity, does Mark Text display
[^1]as a number one superscript, i.e. ¹, or is it literally displayed as ^1 in your text? In my Linux installation, Mark Text displays the latter.N0rbert commentedon Oct 31, 2020
@gilbertohasnofb my main gold standard here is retext.
The PDF and HTML exports from MarkText v0.16.2 looks the same.
But footnote is still moved to the end of document on save.
gilbertohasnofb commentedon Nov 1, 2020
Strangely enough, footnotes do not seem to work on my Linux Mintt 18.3 installation and MarkText 0.16.2. Pasting your minimal example in source code mode:
Going back into regular mode, I see:
So:
[^1]is not resulting in superscripts[^1]:footnote line is not being recognised as a footnote line[^1]:as a footnoteN0rbert commentedon Nov 1, 2020
@gilbertohasnofb this behaviour may be caused by disabled Markdown Extensions (i.e. Use pandoc-style footnotes) in the Preferences. Below is what I have set:
Then after restart I the following:
gilbertohasnofb commentedon Nov 1, 2020
That was it, I did not know that this was not enabled by default. Now I can reproduce your issue and the output looks exactly like the last screenshot.
N0rbert commentedon Nov 29, 2021
Still not fixed in 0.16.3.
Jocs commentedon Jun 27, 2026
Thank you for this report. The behavior you described — footnote definitions being moved to the end of the document on save — was a deliberate (but acknowledged as non-ideal) design decision in the old MarkText editor engine (muyajs). The old lexer explicitly collected all footnote tokens and appended them after all other content.
This issue is fully resolved in the current engine (@muyajs/core). The new markdown parser processes footnote definition blocks in document order and the serializer writes them back at their original position. A document whose footnote definitions appear in the middle will round-trip without any repositioning.
Closing as resolved by the engine migration.