Skip to content

Commit 83b3865

Browse files
chore!: Complete deprecation of custom handlers render method
## Details Completes the removal of `render` method in `custom_handlers`. Originally slated for 2024-08-19, I'll be out around this time for a few days and want to get this plugin into a steady state after the rename. Get the lua rock updated figure out what to do with the old one, etc. I did double check the feature is unused, at least from what's available on Github: - https://github.com/search?q=custom_handlers+render+++language%3ALua&type=code - https://github.com/search?q=custom_handlers+markdown++language%3ALua&type=code - https://github.com/search?q=custom_handlers+MeanderingProgrammer++language%3ALua&type=code No one appears to be using it which gives me enough confidence to remove it early
1 parent 090ea1e commit 83b3865

File tree

5 files changed

+13
-23
lines changed

5 files changed

+13
-23
lines changed

Diff for: CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
22

3-
## Pre-release (slated for 2024-08-19)
3+
## Pre-release
4+
5+
## 6.0.0 (2024-08-05)
46

57
### ⚠ BREAKING CHANGES
68

Diff for: benches/readme_spec.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local util = require('benches.util')
44

55
describe('README.md', function()
66
it('default', function()
7-
local base_marks = 55
7+
local base_marks = 54
88
util.less_than(util.setup('README.md'), 50)
99
util.num_marks(base_marks)
1010

Diff for: doc/todo.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
alignment info.
55
- Figure out how to display the many configuration options & impact, Wiki in progress
66
- Potentially change LuaRocks icon dependency to [mini.icons](https://luarocks.org/modules/neorocks/mini.icons)
7-
- Rename plugin refernces in relevant places, fun :[

Diff for: lua/render-markdown/ui.lua

+7-18
Original file line numberDiff line numberDiff line change
@@ -159,29 +159,18 @@ function M.parse_tree(buf, language, root)
159159
end
160160

161161
local marks = {}
162-
local user_handler = state.custom_handlers[language]
163-
if user_handler ~= nil then
162+
local user = state.custom_handlers[language]
163+
if user ~= nil then
164164
logger.debug('running handler', 'user')
165-
-- TODO: remove call to render & parse nil check
166-
---@diagnostic disable-next-line: undefined-field
167-
if user_handler.render ~= nil then
168-
local message = 'render-markdown.nvim: custom_handlers render is deprecated use parse instead'
169-
message = message .. ', will be fully removed on 2024-08-19'
170-
vim.notify_once(message, vim.log.levels.ERROR)
171-
---@diagnostic disable-next-line: undefined-field
172-
user_handler.render(M.namespace, root, buf)
173-
end
174-
if user_handler.parse ~= nil then
175-
vim.list_extend(marks, user_handler.parse(root, buf))
176-
end
177-
if not user_handler.extends then
165+
vim.list_extend(marks, user.parse(root, buf))
166+
if not user.extends then
178167
return marks
179168
end
180169
end
181-
local builtin_handler = builtin_handlers[language]
182-
if builtin_handler ~= nil then
170+
local builtin = builtin_handlers[language]
171+
if builtin ~= nil then
183172
logger.debug('running handler', 'builtin')
184-
vim.list_extend(marks, builtin_handler.parse(root, buf))
173+
vim.list_extend(marks, builtin.parse(root, buf))
185174
end
186175
return marks
187176
end

Diff for: tests/custom_handler_spec.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('custom_handler.md', function()
5252
util.marks_are_equal(expected, actual)
5353
end)
5454

55-
it('custom override parse', function()
55+
it('custom parse override', function()
5656
util.setup('tests/data/custom_handler.md', {
5757
custom_handlers = {
5858
markdown_inline = {
@@ -73,7 +73,7 @@ describe('custom_handler.md', function()
7373
util.marks_are_equal(expected, actual)
7474
end)
7575

76-
it('custom extends', function()
76+
it('custom parse extend', function()
7777
util.setup('tests/data/custom_handler.md', {
7878
custom_handlers = {
7979
markdown_inline = {

0 commit comments

Comments
 (0)