Skip to content

Commit 0adb35c

Browse files
Add section on some known limitation, unsure if I want to 'fix' them
1 parent 240de21 commit 0adb35c

File tree

3 files changed

+58
-36
lines changed

3 files changed

+58
-36
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Plugin to improve viewing Markdown files in Neovim
2626
- Support for [callouts](https://github.com/orgs/community/discussions/16925)
2727
- Support custom handlers which are ran identically to native handlers
2828

29+
# Known Limitations
30+
31+
- Text that extends beyond available space will overwrite content [#35](https://github.com/MeanderingProgrammer/markdown.nvim/issues/35)
32+
- `LaTeX` formula evaluations are placed above rather than overlayed [#6](https://github.com/MeanderingProgrammer/markdown.nvim/issues/6)
33+
2934
# Dependencies
3035

3136
- [treesitter](https://github.com/nvim-treesitter/nvim-treesitter) parsers:

doc/render-markdown.txt

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 June 05
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 June 08
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
55

66
1. markdown.nvim |render-markdown-markdown.nvim|
77
2. Features |render-markdown-features|
8-
3. Dependencies |render-markdown-dependencies|
9-
4. Install |render-markdown-install|
8+
3. Known Limitations |render-markdown-known-limitations|
9+
4. Dependencies |render-markdown-dependencies|
10+
5. Install |render-markdown-install|
1011
- lazy.nvim |render-markdown-install-lazy.nvim|
1112
- packer.nvim |render-markdown-install-packer.nvim|
12-
5. Setup |render-markdown-setup|
13-
6. Commands |render-markdown-commands|
14-
7. Custom Handlers |render-markdown-custom-handlers|
13+
6. Setup |render-markdown-setup|
14+
7. Commands |render-markdown-commands|
15+
8. Custom Handlers |render-markdown-custom-handlers|
1516
- More Complex Example|render-markdown-custom-handlers-more-complex-example|
16-
8. Purpose |render-markdown-purpose|
17-
9. Markdown Ecosystem |render-markdown-markdown-ecosystem|
17+
9. Purpose |render-markdown-purpose|
18+
10. Markdown Ecosystem |render-markdown-markdown-ecosystem|
1819
- Render in Neovim |render-markdown-markdown-ecosystem-render-in-neovim|
1920
- Render in Browser |render-markdown-markdown-ecosystem-render-in-browser|
2021
- Orthogonal |render-markdown-markdown-ecosystem-orthogonal|
@@ -53,7 +54,14 @@ Plugin to improve viewing Markdown files in Neovim
5354

5455

5556
==============================================================================
56-
3. Dependencies *render-markdown-dependencies*
57+
3. Known Limitations *render-markdown-known-limitations*
58+
59+
- Text that extends beyond available space will overwrite content #35 <https://github.com/MeanderingProgrammer/markdown.nvim/issues/35>
60+
- `LaTeX` formula evaluations are placed above rather than overlayed #6 <https://github.com/MeanderingProgrammer/markdown.nvim/issues/6>
61+
62+
63+
==============================================================================
64+
4. Dependencies *render-markdown-dependencies*
5765

5866
- treesitter <https://github.com/nvim-treesitter/nvim-treesitter> parsers:
5967
- markdown & markdown_inline <https://github.com/tree-sitter-grammars/tree-sitter-markdown>:
@@ -66,7 +74,7 @@ Plugin to improve viewing Markdown files in Neovim
6674

6775

6876
==============================================================================
69-
4. Install *render-markdown-install*
77+
5. Install *render-markdown-install*
7078

7179

7280
LAZY.NVIM *render-markdown-install-lazy.nvim*
@@ -98,7 +106,7 @@ PACKER.NVIM *render-markdown-install-packer.nvim*
98106

99107

100108
==============================================================================
101-
5. Setup *render-markdown-setup*
109+
6. Setup *render-markdown-setup*
102110

103111
Below is the configuration that gets used by default, any part of it can be
104112
modified by the user.
@@ -258,15 +266,15 @@ modified by the user.
258266

259267

260268
==============================================================================
261-
6. Commands *render-markdown-commands*
269+
7. Commands *render-markdown-commands*
262270

263271
`:RenderMarkdownToggle` - Switch between enabling & disabling this plugin
264272

265273
- Function can also be accessed directly through `require('render-markdown').toggle()`
266274

267275

268276
==============================================================================
269-
7. Custom Handlers *render-markdown-custom-handlers*
277+
8. Custom Handlers *render-markdown-custom-handlers*
270278

271279
Custom handlers allow users to integrate custom rendering for either
272280
unsupported languages or to override the native implementations. This can also
@@ -336,7 +344,7 @@ Lets say for `python` we want to highlight lines with function definitions.
336344

337345

338346
==============================================================================
339-
8. Purpose *render-markdown-purpose*
347+
9. Purpose *render-markdown-purpose*
340348

341349
There are many existing markdown rendering plugins in the Neovim ecosystem.
342350
However, most of these rely on syncing a separate browser window with the
@@ -353,7 +361,7 @@ this plugin.
353361

354362

355363
==============================================================================
356-
9. Markdown Ecosystem *render-markdown-markdown-ecosystem*
364+
10. Markdown Ecosystem *render-markdown-markdown-ecosystem*
357365

358366
There are many `markdown` plugins that specialize in different aspects of
359367
interacting with `markdown` files. This plugin specializes in rendering the

tests/init_spec.lua

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ local util = require('plenary.async.util')
44

55
local eq = assert.are.same
66

7-
---@param expected any[]
8-
local function marks_are_equal(expected)
7+
---@param file string
8+
---@param opts? render.md.UserConfig
9+
local function setup(file, opts)
10+
require('render-markdown').setup(opts)
11+
vim.cmd('e ' .. file)
12+
util.scheduler()
13+
end
14+
15+
---@return any[]
16+
local function get_actual_marks()
917
local actual = {}
1018
local marks = vim.api.nvim_buf_get_extmarks(0, ui.namespace, 0, -1, { details = true })
1119
for _, mark in ipairs(marks) do
@@ -23,21 +31,21 @@ local function marks_are_equal(expected)
2331
}
2432
table.insert(actual, mark_info)
2533
end
34+
return actual
35+
end
2636

37+
---@param expected any[]
38+
---@param actual any[]
39+
local function marks_are_equal(expected, actual)
2740
eq(#expected, #actual)
2841
for i, expected_mark_info in ipairs(expected) do
2942
eq(expected_mark_info, actual[i], string.format('Marks at index %d mismatch', i))
3043
end
3144
end
3245

3346
async_tests.describe('init', function()
34-
async_tests.before_each(function()
35-
require('render-markdown').setup({})
36-
end)
37-
3847
async_tests.it('render heading_code.md', function()
39-
vim.cmd('e demo/heading_code.md')
40-
util.scheduler()
48+
setup('demo/heading_code.md')
4149

4250
local expected = {}
4351

@@ -95,12 +103,12 @@ async_tests.describe('init', function()
95103
},
96104
})
97105

98-
marks_are_equal(expected)
106+
local actual = get_actual_marks()
107+
marks_are_equal(expected, actual)
99108
end)
100109

101110
async_tests.it('render list_table.md', function()
102-
vim.cmd('e demo/list_table.md')
103-
util.scheduler()
111+
setup('demo/list_table.md')
104112

105113
local expected = {}
106114

@@ -266,12 +274,12 @@ async_tests.describe('init', function()
266274
},
267275
})
268276

269-
marks_are_equal(expected)
277+
local actual = get_actual_marks()
278+
marks_are_equal(expected, actual)
270279
end)
271280

272281
async_tests.it('render box_dash_quote.md', function()
273-
vim.cmd('e demo/box_dash_quote.md')
274-
util.scheduler()
282+
setup('demo/box_dash_quote.md')
275283

276284
local expected = {}
277285

@@ -343,13 +351,13 @@ async_tests.describe('init', function()
343351
},
344352
})
345353

346-
marks_are_equal(expected)
354+
local actual = get_actual_marks()
355+
marks_are_equal(expected, actual)
347356
end)
348357

349358
async_tests.it('render latex.md', function()
350359
-- TODO: mock interaction with latex2text
351-
vim.cmd('e demo/latex.md')
352-
util.scheduler()
360+
setup('demo/latex.md')
353361

354362
local expected = {}
355363

@@ -385,12 +393,12 @@ async_tests.describe('init', function()
385393
},
386394
})
387395

388-
marks_are_equal(expected)
396+
local actual = get_actual_marks()
397+
marks_are_equal(expected, actual)
389398
end)
390399

391400
async_tests.it('render callout.md', function()
392-
vim.cmd('e demo/callout.md')
393-
util.scheduler()
401+
setup('demo/callout.md')
394402

395403
local expected = {}
396404

@@ -564,6 +572,7 @@ async_tests.describe('init', function()
564572
},
565573
})
566574

567-
marks_are_equal(expected)
575+
local actual = get_actual_marks()
576+
marks_are_equal(expected, actual)
568577
end)
569578
end)

0 commit comments

Comments
 (0)