Skip to content

Add footnotes support#8840

Merged
mejo- merged 17 commits into
mainfrom
feat/footnotes
Jul 13, 2026
Merged

Add footnotes support#8840
mejo- merged 17 commits into
mainfrom
feat/footnotes

Conversation

@mejo-

@mejo- mejo- commented Jul 8, 2026

Copy link
Copy Markdown
Member

📝 Summary

Some implementation details:

  • In UI, the reference IDs are hidden on purpose. Instead, all references and their corresponding footnotes get a sequential ordinal that is displayed. The footnotes are ordered by their ordinal. This is how Obsidian and others do it as well and it avoids confusion regarding manually used and out-of order numeric references.
  • References can be inserted either via [^label] input rule or via Ctrl-Shift-F shortcut. The latter automatically creates a reference ID (the first digit that is not already in use as reference ID).
  • Deleting a reference also removes it's corresponding footnote if no other reference to the footnote exists.

🖼️ Screenshots

Editor Markdown
image grafik

Todo

  • Clarify if we want to add a menubar entry to insert a footnote. If so, where do we place it?

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

🤖 AI (if applicable)

  • The content of this PR was partly generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@mejo- mejo- added this to the Nextcloud 35 milestone Jul 8, 2026
@mejo- mejo- self-assigned this Jul 8, 2026
@mejo- mejo- added enhancement New feature or request feature: formatting Features related to text formatting and node types format: markdown labels Jul 8, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Jul 8, 2026
@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 👀 In review in 📝 Productivity team Jul 8, 2026
@mejo- mejo- force-pushed the feat/footnotes branch from df5b9be to a627bbd Compare July 8, 2026 23:56
@mejo- mejo- requested a review from marcoambrosini July 9, 2026 09:07

@marcoambrosini marcoambrosini left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! A couple of comments from a quick first pass:

  • I would avoid using a container and gray out the text instead
  • I would put this in a new add menu in the toolbar, same as the + in the document, where we can access everything from one bucket. And with a search-bar on top of the list

@mejo-

mejo- commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

I would avoid using a container and gray out the text instead

Good idea, implemented now. See updated screenshot.

I would put this in a new add menu in the toolbar, same as the + in the document, where we can access everything from one bucket. And with a search-bar on top of the list

I added it to the menubar now, which will automatically add it to the + (add) menu in the document.

I'm unsure about the icon to use though. For now I used https://pictogrammers.com/library/mdi/icon/asterisk/ which seems the most fitting to me.

Other icons I considered:

mejo- added 13 commits July 13, 2026 12:54
customize markdown-it-footnote for simpler HTML output structure.

Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
mejo- added 2 commits July 13, 2026 12:55
Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- requested a review from marcoambrosini July 13, 2026 10:56
Comment thread src/nodes/FootnoteReference.ts
mejo- added 2 commits July 13, 2026 18:02
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- merged commit 82a34ab into main Jul 13, 2026
61 checks passed
@mejo- mejo- deleted the feat/footnotes branch July 13, 2026 16:29
@github-project-automation github-project-automation Bot moved this from 👀 In review to ☑️ Done in 📝 Productivity team Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature: formatting Features related to text formatting and node types format: markdown

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Footnote support Footnote support would be nice

3 participants