Skip to content

Commit 8951960

Browse files
chore(refactor): update table class names used while parsing
## Details Fixes collision with `render.md.table.Cell` in configuration. Now each class used while parsing includes information about where it's nested under, i.e. `render.md.table.row.Cell`.
1 parent fcea077 commit 8951960

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

doc/render-markdown.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For NVIM v0.11.6 Last change: 2026 March 07
1+
*render-markdown.txt* For NVIM v0.11.6 Last change: 2026 March 08
22

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

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local state = require('render-markdown.state')
66
local M = {}
77

88
---@private
9-
M.version = '8.11.15'
9+
M.version = '8.11.16'
1010

1111
function M.check()
1212
M.start('versions')

lua/render-markdown/render/markdown/table.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ local str = require('render-markdown.lib.str')
1010

1111
---@class render.md.table.Col
1212
---@field width integer
13-
---@field alignment render.md.table.Alignment
13+
---@field alignment render.md.table.col.Alignment
1414

15-
---@enum render.md.table.Alignment
15+
---@enum render.md.table.col.Alignment
1616
local Alignment = {
1717
left = 'left',
1818
right = 'right',
@@ -23,14 +23,14 @@ local Alignment = {
2323
---@class render.md.table.Row
2424
---@field node render.md.Node
2525
---@field pipes render.md.Node[]
26-
---@field cells render.md.table.Cell[]
26+
---@field cells render.md.table.row.Cell[]
2727

28-
---@class render.md.table.Cell
28+
---@class render.md.table.row.Cell
2929
---@field node render.md.Node
3030
---@field width integer
31-
---@field space render.md.table.Space
31+
---@field space render.md.table.cell.Space
3232

33-
---@class render.md.table.Space
33+
---@class render.md.table.cell.Space
3434
---@field left integer
3535
---@field right integer
3636

@@ -143,7 +143,7 @@ end
143143

144144
---@private
145145
---@param node render.md.Node
146-
---@return render.md.table.Alignment
146+
---@return render.md.table.col.Alignment
147147
function Render.alignment(node)
148148
local left = node:child('pipe_table_align_left')
149149
local right = node:child('pipe_table_align_right')
@@ -167,7 +167,7 @@ function Render:parse_row(node, num_cols)
167167
if not parts or #parts.cells ~= num_cols then
168168
return nil
169169
end
170-
local cells = {} ---@type render.md.table.Cell[]
170+
local cells = {} ---@type render.md.table.row.Cell[]
171171
for i, cell in ipairs(parts.cells) do
172172
-- account for double width glyphs by replacing cell range with width
173173
local start_col = parts.pipes[i].end_col

0 commit comments

Comments
 (0)