chore(release)!: merge v2.0 into main#246
Conversation
There was a problem hiding this comment.
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_plusconfiguration 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()usesgoto continueto skip iterations. As with utils.get_html_block_lines,gotoisn’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 avoidgoto(e.g., wrap the body in a conditional orrepeat ... 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
e19739e to
0a3cc20
Compare
| 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 |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
This prepares the v2.0 major release branch for merge into main.
Tested by make check and targeted spec runs during implementation.