@@ -701,19 +701,22 @@ function Handler:table_full(parsed_table)
701
701
return border [11 ]:rep (column .width )
702
702
end , delim .columns )
703
703
704
- local line_above = spaces > 0 and { { str .spaces (spaces ), ' Normal' } } or {}
705
- table.insert (line_above , { border [1 ] .. table.concat (sections , border [2 ]) .. border [3 ], pipe_table .head })
706
- self :add (false , first .info .start_row , first .info .start_col , {
707
- virt_lines_above = true ,
708
- virt_lines = { self :indent_virt_line (parsed_table .info , line_above ) },
709
- })
704
+ --- @param info render.md.NodeInfo
705
+ --- @param above boolean
706
+ --- @param chars { [1] : string , [2] : string , [3] : string }
707
+ local function table_border (info , above , chars )
708
+ local line = spaces > 0 and { { str .spaces (spaces ), ' Normal' } } or {}
709
+ local highlight = above and pipe_table .head or pipe_table .row
710
+ table.insert (line , { chars [1 ] .. table.concat (sections , chars [2 ]) .. chars [3 ], highlight })
711
+ self :add (false , info .start_row , info .start_col , {
712
+ virt_lines_above = above ,
713
+ virt_lines = { self :indent_virt_line (parsed_table .info , line ) },
714
+ })
715
+ end
710
716
711
- local line_below = spaces > 0 and { { str .spaces (spaces ), ' Normal' } } or {}
712
- table.insert (line_below , { border [7 ] .. table.concat (sections , border [8 ]) .. border [9 ], pipe_table .row })
713
- self :add (false , last .info .start_row , last .info .start_col , {
714
- virt_lines_above = false ,
715
- virt_lines = { self :indent_virt_line (parsed_table .info , line_below ) },
716
- })
717
+ local last_info = # parsed_table .rows == 1 and delim .info or last .info
718
+ table_border (first .info , true , { border [1 ], border [2 ], border [3 ] })
719
+ table_border (last_info , false , { border [7 ], border [8 ], border [9 ] })
717
720
end
718
721
719
722
--- @private
0 commit comments