cortav  Diff

Differences From Artifact [08a1a9b804]:

To Artifact [c03c132cce]:


  1028   1028   			flush()
  1029   1029   			buf.header = c == '+'
  1030   1030   		elseif c == ':' then
  1031   1031   			local lst = l:sub(p.byte-#c,p.byte-#c)
  1032   1032   			local nxt = l:sub(p.next.byte,p.next.byte)
  1033   1033   			if lst == '|' or lst == '+' and l:sub(p.byte-2,p.byte-2) ~= '\\' then
  1034   1034   				buf.align = 'left'
  1035         -			elseif nxt == '|' or nxt == '|' then
         1035  +			elseif nxt == '|' or nxt == '+' then
  1036   1036   				if buf.align == 'left' then
  1037   1037   					buf.align = 'center'
  1038   1038   				else
  1039   1039   					buf.align = 'right'
  1040   1040   				end
  1041   1041   			else
  1042   1042   				buf.str = buf.str .. c
................................................................................
  1076   1076   		j:hook('block_table_insert', c, tbl, l)
  1077   1077   		j:hook('block_table_row_insert', c, tbl, tbl.rows[1], l)
  1078   1078   	end
  1079   1079   end
  1080   1080   
  1081   1081   local function insert_link_block(seq)
  1082   1082   	return blockwrap(function(s,c)
  1083         -		local r = s:sub(#seq):gsub('^%s+','') -- chomp
  1084         -		local uri, txt = r:match('^([^%s]*)%s*(.*)$')
         1083  +		local r = s:sub(#seq+1)
         1084  +		local k, uri, txt = r:match('^(%s*)([^%s]*)%s*(.*)$')
  1085   1085   		return {
  1086         -			uri = ss.uri(uri);
  1087         -			label = ct.parse_span(txt, c);
         1086  +			kind = 'link';
         1087  +			uri = (k~='') and ss.uri(uri) or nil;
         1088  +			ref = (k=='') and uri or nil;
         1089  +			spans = ct.parse_span(txt, c);
  1088   1090   		}
  1089   1091   	end)
  1090   1092   end
  1091   1093   
  1092   1094   ct.ctlseqs = {
  1093   1095   	{seq = '.', fn = insert_paragraph};
  1094   1096   	{seq = 'ΒΆ', fn = insert_paragraph};