@@ -1031,9 +1031,9 @@ local lst = l:sub(p.byte-#c,p.byte-#c) local nxt = l:sub(p.next.byte,p.next.byte) if lst == '|' or lst == '+' and l:sub(p.byte-2,p.byte-2) ~= '\\' then buf.align = 'left' - elseif nxt == '|' or nxt == '|' then + elseif nxt == '|' or nxt == '+' then if buf.align == 'left' then buf.align = 'center' else buf.align = 'right' @@ -1079,13 +1079,15 @@ end local function insert_link_block(seq) return blockwrap(function(s,c) - local r = s:sub(#seq):gsub('^%s+','') -- chomp - local uri, txt = r:match('^([^%s]*)%s*(.*)$') + local r = s:sub(#seq+1) + local k, uri, txt = r:match('^(%s*)([^%s]*)%s*(.*)$') return { - uri = ss.uri(uri); - label = ct.parse_span(txt, c); + kind = 'link'; + uri = (k~='') and ss.uri(uri) or nil; + ref = (k=='') and uri or nil; + spans = ct.parse_span(txt, c); } end) end