Skip to content

feat(footnotes): add comprehensive footnotes support#135

Merged
YousefHadder merged 4 commits intomainfrom
feat/footnotes-support
Nov 27, 2025
Merged

feat(footnotes): add comprehensive footnotes support#135
YousefHadder merged 4 commits intomainfrom
feat/footnotes-support

Conversation

@YousefHadder
Copy link
Copy Markdown
Owner

@YousefHadder YousefHadder commented Nov 27, 2025

Summary

Adds full footnotes support to markdown-plus.nvim, including:

Features

  • Insert footnotes - Create new footnote references and definitions with auto-generated IDs
  • Edit footnotes - Modify existing footnote definitions
  • Delete footnotes - Remove references and definitions with optional confirmation
  • Navigate - Jump between references and definitions bidirectionally
  • List - Browse all footnotes with status indicators using vim.ui.select picker

Code Block Awareness

  • Ignores footnote syntax inside fenced code blocks (``` and ~~~)
  • Ignores footnote syntax inside inline code (...)

Quality

  • Validates footnote IDs before creation
  • Adds empty lines between definition blocks
  • Comprehensive test suite (~30 tests)
  • Type annotations (LuaCATS)

Keymaps

Keymap Action
<leader>mfi Insert footnote
<leader>mfe Edit footnote
<leader>mfd Delete footnote
<leader>mfn Go to next
<leader>mfp Go to previous
<leader>mfl List footnotes
<leader>mfr goto references
<leader>mfg goto definition

Copilot AI review requested due to automatic review settings November 27, 2025 02:57
@YousefHadder YousefHadder changed the title feat: add comprehensive footnotes support feat(footnotes): add comprehensive footnotes support Nov 27, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive footnote support to markdown-plus.nvim, including insertion, editing, deletion, navigation, and listing functionality. However, there are several issues that need to be addressed before merging.

Key Issues Found:

  • Keymap inconsistency: The "renumber footnotes" feature mentioned in the PR description is not implemented
  • Unused configuration options: window_layout and keymaps config options are validated but never used
  • Type annotation problems: Duplicate and inconsistent type definitions between types.lua and parser.lua
  • Missing test coverage: Code block awareness (a key feature) is not tested

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
spec/markdown-plus/footnotes_spec.lua Comprehensive parser and API tests (~30 tests), but missing code block awareness tests
lua/markdown-plus/types.lua Adds footnote type definitions (with inconsistencies) and config types
lua/markdown-plus/init.lua Integrates footnotes module into main plugin initialization
lua/markdown-plus/health.lua Improves error handling with defensive pcall wrappers
lua/markdown-plus/footnotes/window.lua Implements footnote list picker using vim.ui.select
lua/markdown-plus/footnotes/parser.lua Core parsing logic with code block and inline code awareness
lua/markdown-plus/footnotes/navigation.lua Navigation between references and definitions with wrapping
lua/markdown-plus/footnotes/insertion.lua Insert, edit, and delete operations with validation
lua/markdown-plus/footnotes/init.lua Main footnotes module with keymap setup and API
lua/markdown-plus/config/validate.lua Adds validation for footnote config options (includes unused options)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

@YousefHadder YousefHadder merged commit a18473f into main Nov 27, 2025
9 checks passed
@YousefHadder YousefHadder deleted the feat/footnotes-support branch November 27, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants