Skip to content

chore(release)!: merge v2.0 into main#246

Merged
YousefHadder merged 19 commits intomainfrom
v2.0
Mar 8, 2026
Merged

chore(release)!: merge v2.0 into main#246
YousefHadder merged 19 commits intomainfrom
v2.0

Conversation

@YousefHadder
Copy link
Copy Markdown
Owner

This prepares the v2.0 major release branch for merge into main.

  • finalizes the v2 code changes and review remediations
  • consolidates keymap and code-block behavior updates
  • adds clear migration docs in README, vimdoc, and wiki

Tested by make check and targeted spec runs during implementation.

Copilot AI review requested due to automatic review settings March 8, 2026 09:02
@YousefHadder YousefHadder changed the title release: v2.0 major update chore(release)!: merge v2.0 into main Mar 8, 2026
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

Prepares the v2.0 major release for markdown-plus.nvim, focusing on the v2 breaking changes (explicit setup() only, <localleader> keymaps), plus new/updated feature behavior (code blocks, thematic breaks, HTML-block awareness) and expanded test coverage.

Changes:

  • Remove legacy auto-setup / vim.g.markdown_plus configuration path and migrate defaults to <localleader> mappings.
  • Add new modules/features (code blocks, thematic breaks) and HTML-block awareness across formatting/list/header logic.
  • Add/refresh validation, health checks, CI targeting, documentation, and extensive specs for new behaviors.

Reviewed changes

Copilot reviewed 59 out of 59 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
spec/minimal_init.lua Adjust test harness to align with explicit setup() behavior.
spec/markdown-plus/utils_spec.lua Add tests for HTML block scanning helpers.
spec/markdown-plus/treesitter_spec.lua Add tests for treesitter parser-cache cleanup on buffer delete.
spec/markdown-plus/thematic_break_spec.lua New tests for thematic break insertion/cycling + keymaps.
spec/markdown-plus/table_spec.lua Update table <Plug> mapping names and default prefix to <localleader>t.
spec/markdown-plus/list_spec.lua Add tests for smarter grouping/renumbering and smart outdent behaviors.
spec/markdown-plus/links_spec.lua Add tests for smart-paste SSRF blocking helpers + timeout/title truncation.
spec/markdown-plus/health_spec.lua Update health tests to use setup() and assert deprecation warnings.
spec/markdown-plus/headers_spec.lua Add tests for setext headings, TOC keymaps, and HTML-block filtering.
spec/markdown-plus/format_spec.lua Add tests for escape-aware formatting detection + escape-selection mapping.
spec/markdown-plus/format_escape_spec.lua New unit tests for escape/unescape helpers.
spec/markdown-plus/config_spec.lua Update config tests for new keys and remove vim.g config tests.
spec/markdown-plus/code_block_spec.lua New tests covering code-block parsing, insertion/wrap, navigation, and keymaps.
review.md Add/refresh v2.0 review notes and remediation tracking.
plugin/markdown-plus.lua Remove deprecated auto-setup path (plugin file becomes load guard only).
lua/markdown-plus/utils.lua Add HTML block detection + integrate shared code-block parsing.
lua/markdown-plus/types.lua Update public/internal config types for v2 keys and defaults.
lua/markdown-plus/treesitter/init.lua Add BufDelete/BufWipeout cleanup for treesitter parse cache.
lua/markdown-plus/thematic_break/init.lua New thematic break feature module.
lua/markdown-plus/table/row_ops.lua Switch table notifications to centralized notify helper.
lua/markdown-plus/table/keymaps.lua Refactor table keymaps through centralized keymap helper + new <Plug> names.
lua/markdown-plus/table/init.lua Update defaults (notably <localleader>t) and standardize notifications.
lua/markdown-plus/table/helpers.lua Standardize “not in table” warnings via utils notify.
lua/markdown-plus/table/creator.lua Standardize error/warn notifications via utils notify.
lua/markdown-plus/table/conversion.lua Standardize conversion notifications + minor cleanup.
lua/markdown-plus/table/column_ops.lua Standardize warnings via utils notify.
lua/markdown-plus/table/cell_ops.lua Standardize warnings/infos via utils notify.
lua/markdown-plus/table/calculator.lua Standardize destructive-op prompts and results via utils notify.
lua/markdown-plus/quote/init.lua Migrate default keymap to <localleader>.
lua/markdown-plus/list/shared.lua Add parent-at-indent helper to support smart outdent/continuation.
lua/markdown-plus/list/renumber.lua Add HTML-block awareness, merge fragmented groups, and faster apply strategy.
lua/markdown-plus/list/init.lua Debounced insert-mode renumbering and localleader keymap migration.
lua/markdown-plus/list/handlers.lua Add smart outdent/o behaviors and windowed scanning for performance.
lua/markdown-plus/links/smart_paste.lua Add host blocking, timeout clamping, title truncation, curl limits.
lua/markdown-plus/links/init.lua Migrate link keymaps to <localleader>.
lua/markdown-plus/keymap_helper.lua Extend keymap helper with opts + force-default support.
lua/markdown-plus/init.lua Add new feature toggles/config (thematic break, code block, HTML awareness), remove vim.g merge.
lua/markdown-plus/images/init.lua Migrate image keymaps to <localleader>.
lua/markdown-plus/health.lua Validate active config and warn on deprecated vim.g.markdown_plus.
lua/markdown-plus/headers/toc_window.lua Move TOC window mappings to centralized keymap helper.
lua/markdown-plus/headers/parser.lua Add setext parsing + HTML-block filtering support.
lua/markdown-plus/headers/manipulation.lua Implement setext promote/demote and ATX<->setext toggle.
lua/markdown-plus/headers/init.lua Wire up HTML awareness and new ATX/setext toggle keymap.
lua/markdown-plus/format/toggle.lua Add HTML-block awareness gating + escape/unescape selection toggle.
lua/markdown-plus/format/patterns.lua Simplify patterns to wrapper-only definitions.
lua/markdown-plus/format/init.lua Migrate default keys to <localleader> and add escape-selection mapping.
lua/markdown-plus/format/escape.lua New escape/unescape implementation extracted from utils.
lua/markdown-plus/format/detection.lua Rewrite detection to be escape-aware and marker-wrapper driven.
lua/markdown-plus/footnotes/init.lua Migrate footnote keymaps to <localleader>.
lua/markdown-plus/config/validate.lua Add schema/validation for new v2 config keys and bounds.
lua/markdown-plus/code_block/parser.lua New fenced code block parser helpers.
lua/markdown-plus/code_block/navigation.lua New next/prev code block navigation.
lua/markdown-plus/code_block/init.lua New code block feature module + keymaps.
lua/markdown-plus/callouts/init.lua Migrate callout keymaps to <localleader>.
TESTING.md Add manual testing checklist for v2 migration changes.
README.md Add v2 migration notes and link to wiki migration guide.
CHANGELOG.md Add v2.0 “Unreleased” section (but repo indicates changelog is auto-generated).
.github/workflows/ci.yml Run CI on v2.0 branch pushes as well as main.
Comments suppressed due to low confidence (1)

lua/markdown-plus/list/renumber.lua:228

  • find_list_groups() uses goto continue to skip iterations. As with utils.get_html_block_lines, goto isn’t valid in Lua 5.1 (repo runtime is configured as 5.1), so this will break Lua 5.1 compatibility / LuaLS diagnostics. Please rewrite the loop to avoid goto (e.g., wrap the body in a conditional or repeat ... until true).
  local html_block_lines = {}
  if html_awareness then
    html_block_lines = utils.get_html_block_lines(lines)
  end

  for i, line in ipairs(lines) do
    if html_block_lines[i] then
      goto continue
    end

    if code_block_lines[i] then
      -- Non-indented (column 0) code blocks are structural separators per
      -- CommonMark — they break list continuity even without surrounding
      -- blank lines. Clear all active groups on first line of such a region.
      if non_indented_regions[i] and not non_indented_regions[i - 1] then
        current_groups_by_indent = {}
      end
      goto continue
    end

@YousefHadder YousefHadder force-pushed the v2.0 branch 2 times, most recently from e19739e to 0a3cc20 Compare March 8, 2026 09:10
Copilot AI review requested due to automatic review settings March 8, 2026 09:31
@YousefHadder YousefHadder merged commit 91f571a into main Mar 8, 2026
24 checks passed
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 57 out of 57 changed files in this pull request and generated 2 comments.

Comment on lines +120 to +128
local function is_blocked_url(url)
local host = extract_url_host(url)
if not host then
return true, "invalid URL host"
end

if host == "localhost" or host:match("%.localhost$") then
return true, "localhost is not allowed"
end
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The localhost blocking check can be bypassed by equivalent host spellings like localhost. (trailing dot), which currently won't match host == "localhost" or %.localhost$. Consider normalizing the extracted host (e.g., trim a trailing '.') before checks, and/or expanding the localhost/loopback matching to cover these canonicalization cases.

Copilot uses AI. Check for mistakes.
Comment on lines +387 to +395
function M.is_in_html_block(row)
local target_row = row or M.get_cursor()[1]
if not target_row or target_row < 1 then
return false
end

local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
local html_lines = M.get_html_block_lines(lines)
return html_lines[target_row] == true
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

utils.is_in_html_block() currently reads the entire buffer and recomputes HTML block regions on every call. Since this is invoked from word-level formatting toggles, this can become O(n) per keystroke on large files; consider caching the computed html_lines per buffer keyed by changedtick (similar to treesitter parse cache) or exposing a cheaper row-check that reuses a precomputed map.

Copilot uses AI. Check for mistakes.
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