download patch
commit 1c622bc68cc155ecae9419f2c82c40406da5c380
Author: John MacFarlane <jgm@berkeley.edu>
Date: Fri Apr 14 14:24:19 2023 -0700
Further fix to tables in djot-reader.lua. Closes #10.
diff --git a/djot-reader.lua b/djot-reader.lua
index ffcbcdf..93a104b 100644
--- a/djot-reader.lua
+++ b/djot-reader.lua
function Renderer:table(node)
local rows = {}
local headers = {}
local caption = {}
- local aligns = nil
- local widths = nil
+ local aligns = {}
+ local widths = {}
local content = node.c
for i=1,#content do
local row = content[i]
function Renderer:table(node)
local cells = {}
for j=1,#row.c do
cells[j] = self:render_node(row.c[j])
- if not aligns then
- aligns = {}
- widths = {}
+ if not aligns[j] then
local align = row.c[j].align
if not align then
aligns[j] = "AlignDefault"