Index: cortav.lua ================================================================== --- cortav.lua +++ cortav.lua @@ -1035,11 +1035,11 @@ if buf.str ~= '' then flush() end for _,v in pairs(row) do v.spans = ct.parse_span(v.str, c) c.doc.docjob:hook('meddle_span', v.spans, v) end - if #c.sec.blocks > 1 and c.sec.blocks[#c.sec.blocks].kind == 'table' then + if next(c.sec.blocks) and c.sec.blocks[#c.sec.blocks].kind == 'table' then local tbl = c.sec.blocks[#c.sec.blocks] table.insert(tbl.rows, row) j:hook('block_table_attach', c, tbl, row, l) j:hook('block_table_row_insert', c, tbl, row, l) else @@ -1116,13 +1116,13 @@ return (l:match '\t+([^:]+):%s*(.*)$') end; fn = blockwrap(function(l,c,j,d) local ref, val = l:match '\t+([^:]+):%s*(.*)$' local last = d[#d] local rsrc - if last and last.kind == 'resource' - or last.kind == 'embed' - or last.kind == 'macro' then + if last and (last.kind == 'resource' + or last.kind == 'embed' + or last.kind == 'macro') then last.props = last.props or {} last.props[ref] = val j:hook('set_prop', c, last, ref, val, l) rsrc = last elseif last and last.kind == 'reference' and last.rsrc then