cortav  Check-in [e8ab2a68d8]

Overview
Comment:fix stupid table bug
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e8ab2a68d88ab8e76717695264977a614fcb3e96215fc74aef0409dd1e1d9252
User & Date: lexi on 2022-09-09 21:20:50
Other Links: manifest | tags
Context
2022-09-09
22:02
update docs check-in: 35f8445017 user: lexi tags: trunk
21:20
fix stupid table bug check-in: e8ab2a68d8 user: lexi tags: trunk
21:08
macro & doc improvements check-in: 52f88f818d user: lexi tags: trunk
Changes

Modified cortav.lua from [827b243474] to [454581060f].

  1033   1033   		end
  1034   1034   	end
  1035   1035   	if buf.str ~= '' then flush() end 
  1036   1036   	for _,v in pairs(row) do
  1037   1037   		v.spans = ct.parse_span(v.str, c)
  1038   1038   		c.doc.docjob:hook('meddle_span', v.spans, v)
  1039   1039   	end
  1040         -	if #c.sec.blocks > 1 and c.sec.blocks[#c.sec.blocks].kind == 'table' then
         1040  +	if next(c.sec.blocks) and c.sec.blocks[#c.sec.blocks].kind == 'table' then
  1041   1041   		local tbl = c.sec.blocks[#c.sec.blocks]
  1042   1042   		table.insert(tbl.rows, row)
  1043   1043   		j:hook('block_table_attach', c, tbl, row, l)
  1044   1044   		j:hook('block_table_row_insert', c, tbl, row, l)
  1045   1045   	else
  1046   1046   		local tbl = {
  1047   1047   			kind = 'table';
................................................................................
  1114   1114   	end};
  1115   1115   	{seq = '\t', pred = function(l)
  1116   1116   		return (l:match '\t+([^:]+):%s*(.*)$')
  1117   1117   	end; fn = blockwrap(function(l,c,j,d)
  1118   1118   		local ref, val = l:match '\t+([^:]+):%s*(.*)$'
  1119   1119   		local last = d[#d]
  1120   1120   		local rsrc
  1121         -		if last and last.kind == 'resource'
  1122         -		         or last.kind == 'embed'
  1123         -               or last.kind == 'macro' then
         1121  +		if last and (last.kind == 'resource'
         1122  +		         or  last.kind == 'embed'
         1123  +               or  last.kind == 'macro') then
  1124   1124   			last.props = last.props or {}
  1125   1125   			last.props[ref] = val
  1126   1126   			j:hook('set_prop', c, last, ref, val, l)
  1127   1127   			rsrc = last
  1128   1128   		elseif last and last.kind == 'reference' and last.rsrc then
  1129   1129   			last.rsrc.props[ref] = val
  1130   1130   			rsrc = last.rsrc