Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marktext should not move footnotes contents to the real end of document #2036

Open
N0rbert opened this issue Apr 8, 2020 · 8 comments
Open
Labels
🦋 optimization Improve the existing behavior

Comments

@N0rbert
Copy link

N0rbert commented Apr 8, 2020

Description

Using MarkText with version control system become difficult because of moving footnotes to the real end of document.

Steps to reproduce

  1. Have Markdown document with footnotes defined

    Text before footnote.
    
    A footnote [^1]
    
    [^1]: Here is the footnote.
    
    Text after footnote.
    
  2. Open the document using MarkText

  3. Save the document

Expected behavior:

the MarkText does not change the document

Actual behavior:

the MarkText changed the document, moved footnote to the real end of the document:

Text before footnote.

A footnote [^1]

Text after footnote.

[^1]: Here is the footnote.

Versions

  • Mark Text: v0.16.1 AppImage
  • Operating system: Ubuntu MATE 16.04 LTS
@fxha
Copy link
Contributor

fxha commented 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
Copy link
Member

Jocs commented Jun 7, 2020

According pandoc document

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.

@Jocs Jocs added the 🦋 optimization Improve the existing behavior label Jun 7, 2020
@gilbertohasnofb
Copy link

@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
Copy link
Author

N0rbert commented Oct 31, 2020

@gilbertohasnofb my main gold standard here is retext.

retext footnote

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
Copy link

gilbertohasnofb commented 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:

image

Going back into regular mode, I see:

image

So:

  1. The syntax [^1] is not resulting in superscripts
  2. the [^1]: footnote line is not being recognised as a footnote line
  3. 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

@N0rbert
Copy link
Author

N0rbert commented 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:

enable footnotes

Then after restart I the following:

document with footnote

@gilbertohasnofb
Copy link

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
Copy link
Author

N0rbert commented Nov 29, 2021

Still not fixed in 0.16.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦋 optimization Improve the existing behavior
Projects
None yet
Development

No branches or pull requests

4 participants